Hello,
I need to decrypt data with AES/CBC system,
here is my VB.NET routine that I need to convert in B4A:
How can do it in B4A ??
Many thanks
Sergio
I need to decrypt data with AES/CBC system,
here is my VB.NET routine that I need to convert in B4A:
B4X:
Public Function AES_Decrypt(ByVal input As String, ByVal IV As String, ByVal pass As String) As String
Dim inputB = Str2Byte(input) ' convert input data from string di byte array
Dim passB = Str2Byte(pass) ' convert password from string to byte array
Dim IVb = Str2Byte(IV) ' convert IV from string to byte array
' now inputB, passB and IVb are byte array
Dim AES As New System.Security.Cryptography.RijndaelManaged
AES.Padding = System.Security.Cryptography.PaddingMode.PKCS7
AES.Mode = System.Security.Cryptography.CipherMode.CBC
AES.KeySize = 128
AES.BlockSize = 128
AES.IV = IVb
AES.Key = passB
Dim DESDecrypter As System.Security.Cryptography.ICryptoTransform = AES.CreateDecryptor
Dim decryB = DESDecrypter.TransformFinalBlock(inputB, 0, inputB.Length)
Return Encoding.Default.GetString(decryB) ' convert byte array to string
End Function
How can do it in B4A ??
Many thanks
Sergio