views:

49

answers:

1

Using C#, JavaScript & mysql

In the database i have the column like sign,

sign
ONr3XHNaUuROnolZpGSsdI+/b3mfOuXnBW7bW7M7cEBqE1RljubGNyc3f1ilFB1qJC9RkeZgaYcWFF1Z7DbgdHES78AAFYIcGMg5kzQdjR0wr1EQgmW+Z4TfmdmMlwNzbsdCPn6s0Bmlxt5HJ893KLrBGYhIRQre2JVje6u85Qk=
cqz+/tEn2q2Hc7Cwa7bXGYY6K77v37bZOW2HMfSCdmwh/qoFyFCvWo8wH9JpUnHV5V5359ak1fy3/jkO/bIEDDQxkLNtm5VRoBEWKkEJN0jRdGv3UzLXse1hGKQo772xM7De76hcuLE1hUetUhRK75JWwxzqVSqFCC7QLjtLwBg=

Used RSA algroithm for encryption, i want to decrypt the sign column value, how to do that.

Need Help

A: 

You probably should use RSACryptoServiceProvider.ImportCspBlob Method which gets as the parameter byte array with keys data. In your example you may be also should convert this Base64 string to Unicode string bytes (or any else encoding, I don't know which one was used):

string signBase64 = ReadSignFromDB();//here you get the value from DB
byte[] bytes = Convert.FromBase64String(signBase64);
//here you have created rsaCryptoServiceProvider;
rsaCryptoServiceProvider.ImportCspBlob(bytes);

Then you should use RSACryptoServiceProvider as described in RSACryptoServiceProvider Class MSDN Article.

Eugene Cheverda