Forum: Ruby Decryption in ruby

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Vetrivel V. (Guest)
on 2009-02-09 07:18
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.
This topic is locked and can not be replied to.