Click here to Skip to main content
15,903,175 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I build an application to encrypt the data using public key, where I want to import public from my local drive and decrypt the message. Can anyone help me please?

What I have tried:

// Encryption Process
IAsymmetricBlockCipher cipher = new OaepEncoding(new RsaEngine());
cipher.Init(true, publickey);
byte[] ciphertext = cipher.ProcessBlock(tmpSource, 0, tmpSource.Length);
string result = Encoding.UTF8.GetString(ciphertext);
Console.WriteLine("Encrypted text:");
Console.WriteLine(result);
Console.WriteLine();
Console.WriteLine();
Here tmpsource contains the message which I have to encyrpt
Posted
Updated 4-Jan-19 4:25am

1 solution

I already gave you a link for this in your previous question: Want to save RSA public and private key in local drive[^]. If you want to do this properly then you really need to study the MSDN documentation.
 
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