Click here to Skip to main content
15,919,434 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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...
Posted
Comments
thatraja 20-Dec-11 0:57am    
Need more details. Elaborate

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
 
Share this answer
 
v2
Hi,

This article may help you to generate public private key.

thanks
-amit
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900