如何在MVC 5中加密和解密MVC网址以及控制器和操作名称? [英] How to encrypt and decrypt mvc urls along with controller and action name in mvc 5?

查看:78
本文介绍了如何在MVC 5中加密和解密MVC网址以及控制器和操作名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有任何方法可以加密和解密mvc url及其控制器和动作名称.区域名称不应该加密,即网址应如下所示: http://domainName.com/MyAreaName?MyParam =加密

I want to know if there is any way to encrypt and decrypt the mvc urls along with its controller and action names. Areas names should not be encrypted i.e the url should look like this : http://domainName.com/MyAreaName?MyParam=encryption

其中 MyParam 是要传递到url或页面的参数名称.请建议我一些完整的示例链接以了解想法.

where MyParam is the parameter name that is being passed to the url or the page. Please suggest me few complete sample links to get an idea.

推荐答案

好的.这实际上是一个严重的问题,但已解决.加密不是问题的关键,至少不是传统的安全加密.强加密具有多种特性,使其不切实际.

Okay. That is actually a serious, but solved issue. Encryption is NOT the key to the problem, at least not traditional security encryption. There are several properties of strong encryption that makes it impractical.

  1. 性能(加密非常昂贵)
  2. 确定性(没有确定性,您将失去缓存性能)

UUID/GUID

UUID/GUID

避免顺序ID的传统方法是使用非顺序ID.如果您在网站上公开UUID/GUID,可能是黑客无法弄清

The traditional method to avoid sequential ids is to use non-sequential ids. If you expose UUID/GUID on your website, would be hackers would not be able to figure out

  1. 您拥有的最大ID中有多少客户
  2. 如何通过ID访问Bob的帐户.

UUID看起来像 de305d54-75b4-431b-adb2-eb6b9e546014 ,您无法对其递增以找到下一条记录.

UUIDs look like de305d54-75b4-431b-adb2-eb6b9e546014 and you cannot increment it to find the next record.

这篇关于如何在MVC 5中加密和解密MVC网址以及控制器和操作名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆