分别使用公钥和私钥对明文进行加密和解密 [英] encrypt and Decrypt the plain text using public key and private key respectively
本文介绍了分别使用公钥和私钥对明文进行加密和解密的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好
我正在学习创建公用密钥和专用密钥,此后,我需要在C#.net中使用公用密钥加密数据并使用专用密钥解密数据
任何人请给我一个主意,
非常感谢
Hi all
i am learning to create the public key and private key , after that i need to encrypt the data using the public key and decrypt the data using private key in C#.net
any one give me a idea please ,
thanks alot
推荐答案
很多建议和文章 ^ ].
Lots of suggestions and articles here[^].
查看代表.NET库中实现的所有非对称加密算法的所有派生类的基础抽象类System.Security.Cryptography.AsymmetricAlgorithm
.
为了您的目的,您可以使用具体的类System.Security.Cryptography.ECDiffieHellman
,System.Security.Cryptography.ECDsa
或System.Security.Cryptography.RSA
.
特别是,对于RSA,请使用方法System.Security.Cryptography.RSA.EncryptValue
和System.Security.Cryptography.RSA.DecryptValue
.
请参阅 http://msdn.microsoft.com/en-us/library/system .security.cryptography.asymmetricalgorithm.aspx [ ^ ],
http://msdn.microsoft.com/en-us/library/system. security.cryptography.rsa.aspx [ ^ ].
—SA
Look at the base abstract classSystem.Security.Cryptography.AsymmetricAlgorithm
for all derived classes representing asymmetric cryptography algorithms implemented in .NET library.
For you purposes you can use concrete classesSystem.Security.Cryptography.ECDiffieHellman
,System.Security.Cryptography.ECDsa
orSystem.Security.Cryptography.RSA
.
In particular, with the RSA use the methodsSystem.Security.Cryptography.RSA.EncryptValue
andSystem.Security.Cryptography.RSA.DecryptValue
.
See http://msdn.microsoft.com/en-us/library/system.security.cryptography.asymmetricalgorithm.aspx[^],
http://msdn.microsoft.com/en-us/library/system.security.cryptography.rsa.aspx[^].
—SA
这篇关于分别使用公钥和私钥对明文进行加密和解密的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文