I have code in C#, could you describe in words what is happening in the code? I tried to reproduce using this theme and this one aaand this one. But I didn't succeed. If you throw an example, it would be absolutely wonderful.
public static string Decrypt(byte[] bytesToBeDecrypted)
{
byte[] decryptedBytes;
using (var ms = new MemoryStream())
{
using (var aes = new RijndaelManaged())
{
aes.KeySize = 256;
aes.BlockSize = 128;
var key = new Rfc2898DeriveBytes(CryptKey, SaltBytes, 1000);
aes.Key = key.GetBytes(aes.KeySize / 8);
aes.IV = key.GetBytes(aes.BlockSize / 8);
aes.Mode = CipherMode.CBC;
using (var cs = new CryptoStream(ms, aes.CreateDecryptor(), CryptoStreamMode.Write))
{
cs.Write(bytesToBeDecrypted, 0, bytesToBeDecrypted.Length);
cs.Close();
}
decryptedBytes = ms.ToArray();
}
}
return Encoding.UTF8.GetString(decryptedBytes);
}
libs: System, System.IO, System.Linq, System.Security.Cryptography, System.Text