Please bear with me on this as i have not long been learning how PHP works and am still learning VB.NET slowly. I have been testing the code for PHP using the Apache webserver.
The problem i am having is, this is the function i am using with PHP:
<?php $pwd="test"; $hash = base64_encode(md5($pwd)); echo $hash ?>
This is the coding used for VB.NET
Imports System.Text Imports System.Security.Cryptography Public Function GenerateHashMD5(ByVal SourceText As String) As String Dim Ue As New UnicodeEncoding() Dim ByteSourceText() As Byte = Ue.GetBytes(SourceText) Dim Md5 As New MD5CryptoServiceProvider() Dim ByteHash() As Byte = Md5.ComputeHash(ByteSourceText) Return Convert.ToBase64String(ByteHash) End Function
The results using the password 'test' are as follows:
I know that something in one of the sections of code is very badly wrong, and im pretty sure it will be the VB.NET, but any ideas as to how i can modify it so that they both produce the same answer? Any feedback would be a godsend as i am out of ideas at the moment...