Padding is invalid and cannot be removed Exception while decrypting string using “AesManaged” C#
问题 Please suggest me where i need to update/refactor the code to get rid of exception. I am getting exception while I try to decrypt the encrypted string using following code. Following line is throwing exception using (StreamReader srDecrypt = new StreamReader(csDecrypt)) { // Read the decrypted bytes from the decrypting stream // and place them in a string. plaintext = srDecrypt.ReadToEnd(); } public string EncryptAuthenticationTokenAes(string plainText) { byte[] encrypted; // Create an