Hello,
I am encrypting data using the below AES code:
Public AesIV As String = "1233123456789012"
Public AesKey As String = "1233123456789012"
Private Function aesEncrypt(strData As String) As String
' AesCryptoServiceProvider
Dim aes As New AesCryptoServiceProvider()
aes.BlockSize = 128
aes.KeySize = 128
aes.IV = Encoding.UTF8.GetBytes(AesIV)
aes.Key = Encoding.UTF8.GetBytes(AesKey)
aes.Mode = CipherMode.CBC
aes.Padding = PaddingMode.PKCS7
' Convert string to byte array
Dim src As Byte() = Encoding.Unicode.GetBytes(strData)
' encryption
Using enc As ICryptoTransform = aes.CreateEncryptor()
Dim dest As Byte() = enc.TransformFinalBlock(src, 0, src.Length)
'encode encrypted bytes to URL safe string and return
Return HttpServerUtility.UrlTokenEncode(dest)
End Using
End Function
As you can see I currently set the aes.KeySize to 128 bit and
Go to the complete details ...