C#为DSA加密算法生成公钥和私钥 [英] C# generate a public and private keys for the DSA encryption algorithm
本文介绍了C#为DSA加密算法生成公钥和私钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何以字节数组格式生成DSA算法的公钥和私钥?
How do I generate a public and a private key for the DSA algorithm in byte array format?
推荐答案
在DSA算法中(从维基):
- 公钥是(p,q,g,y)。
-
私钥是x。
- Public key is (p, q, g, y).
Private key is x.
var dsa = new DSACryptoServiceProvider();
var privateKey = dsa.ExportParameters(true); // private key
var publicKey = dsa.ExportParameters(false); // public key
在publicKey中, Q,G,Y属性
In publicKey it's P, Q, G, Y propertyes
在privateKey中,它是X
In privateKey it's X
不要忘了接受这个答案!
And don't forget to accept this answer!
这篇关于C#为DSA加密算法生成公钥和私钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文