I'm trying to encrypt a string in a Universal Windows Platform (UWP) application and decrypt the string in a Web application API.
The problem is that I can not find / modify an algorithm common to both platforms.
I currently use the code below in the UWP project to encrypt
SymmetricKeyAlgorithmProvider aesCbcPkcs7 = SymmetricKeyAlgorithmProvider
.OpenAlgorithm(SymmetricAlgorithmNames.AesCbcPkcs7);
IBuffer keymaterial = CryptographicBuffer.ConvertStringToBinary(CHAVE,
BinaryStringEncoding.Utf8);
CryptographicKey k = aesCbcPkcs7.CreateSymmetricKey(keymaterial);
byte[] value = Encoding.UTF8.GetBytes("STRING");
IBuffer buff = CryptographicEngine.Encrypt(k,
CryptographicBuffer.CreateFromByteArray(value),
keymaterial);
return CryptographicBuffer.EncodeToBase64String(buff);
But when I try to decrypt within the Web API project I get the error: Operation is not supported on this platform
How to make an algorithm that works on both platforms?