Пример #1
0
 public static string RSADecrypt(string xmlPrivateKey, string m_strDecryptSecret)
 {
     byte[] btDecryptedSecret = Convert.FromBase64String(m_strDecryptSecret);
     btDecryptedSecret = CRSAWrap.DecryptBuffer(xmlPrivateKey, btDecryptedSecret);
     return(Encoding.UTF8.GetString(btDecryptedSecret));
 }
Пример #2
0
 public static string RSAEncrypt(string xmlPublicKey, string m_strEncryptString)
 {
     byte[] btEncryptedSecret = EncodingInstance.Instance.GetBytes(m_strEncryptString);
     btEncryptedSecret = CRSAWrap.EncryptBuffer(xmlPublicKey, btEncryptedSecret);
     return(Convert.ToBase64String(btEncryptedSecret));
 }