Hello.
Decrypt code.
What should I do with the Encrypt code of this Decrypt code?
Please Help me
Decrypt code.
What should I do with the Encrypt code of this Decrypt code?
Please Help me
C#:
public string Decrypt(string data)
{
using (RijndaelManaged rijndael = new RijndaelManaged())
using (Rfc2898DeriveBytes rfc2898 = new Rfc2898DeriveBytes(_Key, Convert.FromBase64String(data).Take(16).ToArray()))
using (ICryptoTransform decryptor = rijndael.CreateDecryptor(rfc2898.GetBytes(32), rfc2898.GetBytes(16)))
using (MemoryStream memoryStream = new MemoryStream(Convert.FromBase64String(data).Skip(16).ToArray()))
using (CryptoStream cryptoStream = new CryptoStream(memoryStream, decryptor, CryptoStreamMode.Read))
using (StreamReader streamReader = new StreamReader(cryptoStream))
data = streamReader.ReadToEnd();
return data;
}