mervick / aes-everywhere

Aes Everywhere - Cross Language AES 256 Encryption Library (Bash, Powershell, C#, Dart, GoLang, Java, JavaScript, Lua, PHP, Python, Ruby, Swift)
Other
474 stars 169 forks source link

.NET C# "Padding is invalid and cannot be removed." #39

Open AlaghbariKamel opened 1 year ago

AlaghbariKamel commented 1 year ago

System.Security.Cryptography.CryptographicException: "Padding is invalid and cannot be removed."

mervick commented 1 year ago

Make sure that the keys you use to encrypt and decrypt are the same. The padding method even if not explicitly set should still allow for proper decryption/encryption (if not set they will be the same). However if you for some reason are using a different set of keys for decryption than used for encryption you will get this error:

  Padding is invalid and cannot be removed  
Parinita-AA commented 4 months ago

I see c sharp says don't use its buggy! Is it fixed?

mervick commented 4 months ago

Where did you seen that?

Parinita-AA commented 4 months ago

https://github.com/mervick/aes-everywhere/tree/master/cpp here

mervick commented 4 months ago

It's about c++, not about c sharp