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