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