使用.NET加密和解密数字 [英] Encrypting and Decrypting Numbers with .NET
问题描述
什么是.NET可用的加密技术(使用C#)。我有一个数字值我想加密一个字符串表示。哪一个具有解密支持?
What are Encryption techniques available with .NET (using C#). I have a numeric value with me which I want to encrypt to a string representation. Which one has decrypting support ?
推荐答案
加密(由.NET框架/ BCL提供,而不是C#语言)工作在字节。但是没关系数字很容易表示为字节,输出字节可以通过 Convert.ToBase64String
写入字符串。
Encryption (which is provided by the .NET framework / BCL, not C# the language) typically works on bytes. But that is fine; numbers are easy to represent as bytes, and the output bytes can be written as a string via Convert.ToBase64String
.
所以所有这些,间接地...
So "all of them, indirectly"...
请参阅 MSDN上的System.Security.Cryptography
(重新解密:加密可以被解密;一个哈希不能(希望);所以只要你不看哈希函数,你应该罚款)
(re decrypting: an encryption can be decrypted; a hash cannot (hopefully); so as long as you don't look at hashing functions, you should be fine)
这篇关于使用.NET加密和解密数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!