問(wèn)題描述
我知道 RSACryptoServiceProvider 可以用公鑰加密,然后可以用私鑰解密.
I know that RSACryptoServiceProvider can encrypt with the public key, then it can be decrypted with the private key.
是否可以使用 RSACryptoServiceProvider 使用私鑰加密并使用公鑰解密?
Is it possible to encrypt with the private key and decrypt with the public key using the RSACryptoServiceProvider ?
推薦答案
沒(méi)有.這不是任何公鑰/私鑰加密的工作方式.只能用公鑰加密,只能用私鑰解密.
No. That's not how any public/private key encryption works. You can only encrypt with the public key, and only decrypt with the private key.
如果您想將私鑰應(yīng)用于消息,也許您正在尋找 簽名,而不是加密?這是一種不同的加密方案,也可以使用 RSA 密鑰.
If you want to apply the private key to a message, maybe you're looking for a signature, rather than encryption? This is a different cryptographic scheme that can also use RSA keys.
這篇關(guān)于是否可以使用.net RSACryptoServiceProvider 使用私鑰加密?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!