开发者

Decrypting data with javascript - ASP.NET website

开发者 https://www.devze.com 2022-12-15 00:28 出处:网络
I use a hidden variable (input type=hidden) to store ID information on a page. To prevent attackers, I decided to encrypt the data stored usi开发者_Go百科ng System.Security.Cryptography.

I use a hidden variable (input type=hidden) to store ID information on a page. To prevent attackers, I decided to encrypt the data stored usi开发者_Go百科ng System.Security.Cryptography.

The hidden variable is accessed in JS and executes validation logic. I will need to decrypt the data before executing the validation logic. Is there a way to decrypt data in JS that was encrypted using System.Security.Cryptography


If you can decrypt it using JavaScript on the client side, so can any attacker. This approach is flawed for that reason. The Validation logic also needs to be done server side. You should never trust client side validation for anything that could potentially hurt your site.

0

精彩评论

暂无评论...
验证码 换一张
取 消