Hi All,
First I want to say, I am very happy with B4A.
So, I am fighting with the Encryption library right now.
I am using the follow C# code to encrypt my data, and I need the code in B4A to decrypt it.
I am sure I can decrypt the message with B4A but I not sure how write the code..
Can someone help me?
Thanks in Advance.
Eugenio Serrano
First I want to say, I am very happy with B4A.
So, I am fighting with the Encryption library right now.
I am using the follow C# code to encrypt my data, and I need the code in B4A to decrypt it.
B4X:
public static string Encrypt(string sourceString, string key)
{
Byte[] buffer = Encoding.ASCII.GetBytes(sourceString);
TripleDESCryptoServiceProvider des = new TripleDESCryptoServiceProvider();
MD5CryptoServiceProvider MD5 = new MD5CryptoServiceProvider();
des.Key = MD5.ComputeHash(ASCIIEncoding.ASCII.GetBytes(key)) ;
des.IV = _Iv; // _Iv is a byte array (Initialization Vector)
string result = Convert.ToBase64String(des.CreateEncryptor().TransformFinalBlock(buffer, 0, buffer.Length));
des.Clear();
MD5.Clear();
return result;
}
I am sure I can decrypt the message with B4A but I not sure how write the code..
Can someone help me?
Thanks in Advance.
Eugenio Serrano
Last edited: