Decryption in ruby

Discussion in 'Ruby' started by Vetrivel Vetrivel, Feb 9, 2009.

  1. 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.
    --
    Posted via http://www.ruby-forum.com/.
     
    Vetrivel Vetrivel, Feb 9, 2009
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Srinivasa Reddy K Ganji

    database connection string encryption and decryption

    Srinivasa Reddy K Ganji, Jul 18, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    700
    Gary Varga
    Jul 18, 2003
  2. John Saunders
    Replies:
    1
    Views:
    681
    John Saunders
    Nov 18, 2003
  3. Replies:
    2
    Views:
    1,609
    Sushant Bhatia
    May 3, 2005
  4. Showjumper

    Problem with decryption

    Showjumper, Jan 23, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    402
    Showjumper
    Jan 23, 2006
  5. Showjumper

    Problem with decryption

    Showjumper, Jan 25, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    497
    Showjumper
    Jan 27, 2006
Loading...

Share This Page