Public Function AES_Encrypt(ByVal input As String, ByVal pass As String) As String
Dim AES As New RijndaelManaged
Dim Hash_AES As New MD5CryptoServiceProvider
Dim encrypted As String = ""
Try
Dim hash(31) As Byte
Dim temp As Byte() = Hash_AES.ComputeHash(ASCIIEncoding.ASCII.GetBytes(pass))
Array.Copy(temp, 0, hash, 0, 16)
Array.Copy(temp, 0, hash, 15, 16)
AES.Key = hash
AES.Mode = CipherMode.ECB '' I have tried every option here
Dim DESEncrypter As ICryptoTransform = AES.CreateEncryptor
Dim Buffer As Byte() = ASCIIEncoding.ASCII.GetBytes(input)
encrypted = Convert.ToBase64String(DESEncrypter.TransformFinalBlock(Buffer, 0, Buffer.Length))
Return encrypted
Catch ex As Exception
Debug.Print(ex.Message)
Return "Error"
End Try
End Function