4

How can i Convert my password 'String' to Base64 encode of MD5 'String'. Like this string 'password' to 'X03MO1qnZdYdgyfeuILPmQ=='.

Please help me here

OR just let me know the technique that how can i convert this 'password' to 'X03MO1qnZdYdgyfeuILPmQ=='. i will code it myself

7
  • in this case btoa('password') = "cGFzc3dvcmQ=" . i need an output of "X03MO1qnZdYdgyfeuILPmQ==" Commented Nov 15, 2015 at 12:48
  • Take a look to this Commented Nov 15, 2015 at 13:53
  • Did I understand well, You want encode string password using MD5 and then that result to Base64? Commented Nov 15, 2015 at 17:17
  • yes you are right. i tried but my answer is different than 'X03MO1qnZdYdgyfeuILPmQ==' Commented Nov 15, 2015 at 17:19
  • @ZaidIqbal I posted answer so, try it. Commented Nov 15, 2015 at 17:25

1 Answer 1

8

Ok, there is example (vb.net, I'll try to convert in c# using some online converter) :

Dim pwd As String = "password"
Dim hs As System.Security.Cryptography.MD5 = System.Security.Cryptography.MD5.Create
Dim db As Byte() = hs.ComputeHash(System.Text.Encoding.UTF8.GetBytes(pwd))
Dim result As String = Convert.ToBase64String(db)

string password will result with X03MO1qnZdYdgyfeuILPmQ==

Update : converted to c# using online converter (I hope it's correctly converted)

string pwd = "password";
System.Security.Cryptography.MD5 hs = System.Security.Cryptography.MD5.Create;
byte[] db = hs.ComputeHash(System.Text.Encoding.UTF8.GetBytes(pwd));
string result = Convert.ToBase64String(db);
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.