I am trying to implement a simple Encryption of a string.
I am getting "The supplied user buffer is not valid for the requested operation" error.
I am targeting Rindael Algorithm But currently I am using AesEcb.
I dont know what is the problem in the implementation.
Below is the code snippet.
var keyHash = GetMD5Hash(key);
var toDecryptBuffer = CryptographicBuffer.ConvertStringToBinary(toEncrypt, BinaryStringEncoding.Utf8);
var aes = SymmetricKeyAlgorithmProvider.OpenAlgorithm(SymmetricAlgorithmNames.AesEcb);
var symetricKey = aes.CreateSymmetricKey(keyHash);
var buffEncrypted = CryptographicEngine.Encrypt(symetricKey, toDecryptBuffer, null);