C# generate a public and private keys for the DSA encryption algorithm [closed]

时间秒杀一切 提交于 2020-01-02 18:25:13

问题


How do I generate a public and a private key for the DSA algorithm in byte array format?


回答1:


In DSA algorithm (from wiki):

  • 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
    

In publicKey it's P, Q, G, Y propertyes

In privateKey it's X

And don't forget to accept this answer!



来源:https://stackoverflow.com/questions/7545877/c-sharp-generate-a-public-and-private-keys-for-the-dsa-encryption-algorithm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!