Encryption is triple DES, which gives me a result in Byte Array, the byte array is converted to a string using System.Text.ASCIIEncoding
the resulting string is stored in Javascript, later to be passed to a webservice which decrypts the password to authenticate the user
This works perfectly for some passwords, and not for others. My username for example, returns "Bad Data" error from the Decrypt function. I assume that this is due to a problem converting some strings from byte[] to string. Is there a more reliable method that I can use?
VB.NET:
Dim oEncryption As New Score.Common.Encryption
Dim oEncode As New System.Text.ASCIIEncoding
strEncodedString = oEncode.GetString(oEncryption.Encrypt(oUser.UserName))
the resulting string is stored in Javascript, later to be passed to a webservice which decrypts the password to authenticate the user
VB.NET:
Dim oEncryption As New Score.Common.Encryption
Dim oEncode As New System.Text.ASCIIEncoding
Dim strNonEncodedString As String = oEncryption.Decrypt(oEncode.GetBytes(pw))
Return strNonEncodedString
This works perfectly for some passwords, and not for others. My username for example, returns "Bad Data" error from the Decrypt function. I assume that this is due to a problem converting some strings from byte[] to string. Is there a more reliable method that I can use?