Decryption in ruby

  • Thread starter Vetrivel Vetrivel
  • Start date
V

Vetrivel Vetrivel

I have a decryption doutes in ruby.

A person encrypts the data in c# language using
RSACryptoServiceProvider class.
Example RSA decryption in c# Language

Deryption Algorithm in C#

public static string DecryptData(string data2Decrypt)
{
AssignParameter();
byte[] getpassword = Convert.FromBase64String(data2Decrypt);
StreamReader reader = new StreamReader(@"C:\Keys\privatekey.xml");
string publicPrivateKeyXML = reader.ReadToEnd();
rsa.FromXmlString(publicPrivateKeyXML);
reader.Close();
//read ciphertext, decrypt it to plaintext
byte[] plain = rsa.Decrypt(getpassword, false);
return System.Text.Encoding.UTF8.GetString(plain);
}

How to do c# Decryption in ruby.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top