D4RKKNIGH7
Member
- Joined
- Sep 13, 2011
- Messages
- 12
- Programming Experience
- 5-10
Hey guys,
I have a small problem I have been working on for the last few hours.
What I am trying to do is make a program that you are able to log into. But to be able to log into it you need to have an account on my forum. I am using MyBB and I have the SALT and Encrypted strings, but when ever i try to hash my own string it doesn't match up.
String im trying to hash: lolcake
the hashed string:
I have a small problem I have been working on for the last few hours.
What I am trying to do is make a program that you are able to log into. But to be able to log into it you need to have an account on my forum. I am using MyBB and I have the SALT and Encrypted strings, but when ever i try to hash my own string it doesn't match up.
String im trying to hash: lolcake
the hashed string:
a4ec54ee776c96ca5441aca7e052fc35
salt: AiAZW8VT
String i get when i use the code below: HQ6roMkvv2BpXsS+FZSb9A==
Code im using
String i get when i use the code below: HQ6roMkvv2BpXsS+FZSb9A==
Code im using
VB.NET:
Dim strText As String = "lolcake"
Dim salt As String = "AiAZW8VT"
Dim bytHashedData As Byte()
Dim encoder As New UTF8Encoding()
Dim md5Hasher As New MD5CryptoServiceProvider
' Get Bytes for "password"
Dim passwordBytes As Byte() = encoder.GetBytes(strText)
' Get Bytes for "salt"
Dim saltBytes As Byte() = encoder.GetBytes(salt)
' Creat new Array to store both "password" and "salt" bytes
Dim passwordAndSaltBytes As Byte() = _
New Byte(passwordBytes.Length + saltBytes.Length - 1) {}
' Store "password" bytes
For i As Integer = 0 To passwordBytes.Length - 1
passwordAndSaltBytes(i) = passwordBytes(i)
Next
' Append "salt" bytes
For i As Integer = 0 To saltBytes.Length - 1
passwordAndSaltBytes(i + passwordBytes.Length) = saltBytes(i)
Next
' Compute hash value for "password" and "salt" bytes
bytHashedData = md5Hasher.ComputeHash(passwordAndSaltBytes)
' Convert result into a base64-encoded string.
Dim hashValue As String
hashValue = Convert.ToBase64String(bytHashedData)
MsgBox(hashValue.ToString)