We are using this Microsoft sample code (https://learn.microsoft.com/en-us/dotnet/api/system.security.cryptography.aes?view=net-7.0) to generate the encrypted information, then Convert.ToBase64String()
to achieve valueA
shown below.
The encrypted information is this (valueA
):
i6k/KpzA/5O8w557u4X+nhprrOWj4KwxChIqw2mgt/Dc6AuFGT9piTuYtytQf8ZdlRe8Z3MeL20oUOimGeo2xA==
If we pass it via URL it changes to this (valueB
):
i6k%2FKpzA%2F5O8w557u4X%2BnhprrOWj4KwxChIqw2mgt%2FDc6AuFGT9piTuYtytQf8ZdlRe8Z3MeL20oUOimGeo2xA%3D%3D
So, when we try to decrypt this valueB
information we apply Convert.FromBase64String()
, but it returns an error due to charset replacement.
How can I make this work?