Example #1
0
 public string Decrypt(string encryptedBase64String)
 {
     byte[] encryptedData = RSAHelper.RsaDecrypt(Convert.FromBase64String(encryptedBase64String), privateKey.D, privateKey.Modulus);
     return(Encoding.Unicode.GetString(encryptedData));
 }
Example #2
0
 public string Encrypt(string stringDataToEncrypt)
 {
     byte[] encryptedData = RSAHelper.RsaEncrypt(Encoding.Unicode.GetBytes(stringDataToEncrypt), publicKey.Exponent, publicKey.Modulus);
     return(Convert.ToBase64String(encryptedData));
 }