如何动态生成键值 [英] how to generate key value in dynamically

查看:61
本文介绍了如何动态生成键值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以提供C#代码:


我想动态生成公钥为234,235等,而私钥则依赖于公钥,例如2341,2342 ...

Can Anyone Give C# code:


i want to dynamicaly generate public key as 234,235 etc and private key is depend on public key it like 2341,2342...

推荐答案

否,不是私钥取决于公钥,反之亦然.两者具有平等权利",并且是同时生成的,仅以不同的方式使用.

我觉得您需要对公钥加密和数字签名进行一些介绍:
http://en.wikipedia.org/wiki/Public-key_cryptography [ http://en.wikipedia.org/wiki/Digital_signature [ http://msdn .microsoft.com/en-us/library/system.security.cryptography.asymmetricalgorithm.aspx [
No, it''s not that a private key depends on a public key or visa versa. The two have "equal rights" and are generated at the same time, only used in different ways.

I feel you need some introduction of public-key cryptography and digital signatures:
http://en.wikipedia.org/wiki/Public-key_cryptography[^],
http://en.wikipedia.org/wiki/Digital_signature[^].

As to the key generation and other parts of the algorithm, it depends on what kind of algorithm you chose to use.
Any algorithm you may want to use falls into a category of asymmetric algorithms. See what''s available in the standard .NET library: http://msdn.microsoft.com/en-us/library/system.security.cryptography.asymmetricalgorithm.aspx[^].

Normally, the key pair is created when you call a constructor of a non-abstract class implementing a concrete algorithm. Please review the help pages on each class based on System.Security.Cryptography.AsymmetricAlgorithm to chose the algorithm you need and understand the issues with generating the keys and handling them which is a key (pub unintended) aspect of each of those algorithms.

—SA




文章可以帮助您生成公共私钥.

谢谢
-amit
Hi,

This article may help you to generate public private key.

thanks
-amit


这篇关于如何动态生成键值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆