BO4E-dotnet.Encryption/AsymmetricEncrypter.cs
/// <summary>
///     Encrypt a plain text with a public key
/// </summary>
/// <param name="plainText">UTF-8 encoded string containing the plain text to be encrypted</param>
/// <param name="recipientsPublicKey">public key of receiver</param>
/// <returns>Tuple of (cipherText, nonce); both as base64 encoded string</returns>
Encrypt a plain text with a public key
Encrypt a plain text with a public key
public (string, string) Encrypt(string plainText, string recipientsPublicKey)
        {
            var nonce = PublicKeyBox.GenerateNonce();
            return (Encrypt(plainText, recipientsPublicKey, nonce), Convert.ToBase64String(nonce));
        }
public ( string , string ) Encrypt ( string plainText , string recipientsPublicKey ) { var nonce = PublicKeyBox . GenerateNonce ( ) ; return ( Encrypt ( plainText , recipientsPublicKey , nonce ) , Convert . ToBase64String ( nonce ) ) ; }
Encrypt a plain text with a public key
Encrypt a plain text with a public key
Tuple of (cipherText, nonce); both as base64 encoded string
Tuple of ( cipherText nonce ) ; both as base64 encoded string
plainText
string
UTF-8 encoded string containing the plain text to be encrypted
UTF - 8 encoded string containing the plain text to be encrypted
recipientsPublicKey
string
public key of receiver
public key of receiver