加密和解密 [英] Encryption and decryption

查看:111
本文介绍了加密和解密的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





如何仅在符号中获取加密字符串,意味着它不应包含任何字母或数字,并且加密字符串的长度也应该是25.请同样提供解密方法。



请回复。



谢谢.. < br $> b $ b

我尝试了什么:



我尝试使用TripleDESCryptoServiceProvider进行加密和解密给出加密字符串的类,但是我不能仅以符号形式获得加密字符串,也不能限制长度。有没有任何属性或方法可以做到这一点?

Hi,

How to get encrypted string only in symbols, means it should not contain any letter or digit, and also the length of the encrypted string should be 25. Please provide decryption method also for the same.

Please reply.

Thanks..

What I have tried:

I tried encryption and decryption using TripleDESCryptoServiceProvider class which gives encrypted string, but I am not able to get encrypted string in only symbolic form and also can not limit the length. Is there any property or method to do this?

推荐答案

没有。你不能强加加密数据的最大长度,因为它在很大程度上取决于输入数据的长度。

你不应该加密密码,你应该对它们进行散列 - 见这里:密码存储:怎么做。 [ ^ ]

散列确实修复输出数据的长度。
No. You cannot force a maximum length on encrypted data, as it is massively dependent on the length of the input data.
You should not be encrypting passwords anyway, you should be hashing them - see here: Password Storage: How to do it.[^]
Hashing does "fix" the length of the output data.


这篇关于加密和解密的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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