BO4E-dotnet.Encryption/SymmetricEncrypter.cs
/// <summary>
///     Encrypt a given plain text and add associated data.
/// </summary>
/// <param name="plainText">UTF-8 encoded string containing the plain text to be encrypted</param>
/// <param name="associatedDataString">max. 16 character long string (not secret)</param>
/// <returns>Tuple of (cipherText, nonce); both as base64 encoded string</returns>
Encrypt a given plain text and add associated data.
Encrypt a given plain text and add associated data .
public (string, string) Encrypt(string plainText, string associatedDataString)
        {
            var nonce = SecretAeadChaCha20Poly1305.GenerateNonce();
            return (Encrypt(plainText, associatedDataString, nonce), Convert.ToBase64String(nonce));
        }
public ( string , string ) Encrypt ( string plainText , string associatedDataString ) { var nonce = SecretAeadChaCha20Poly1305 . GenerateNonce ( ) ; return ( Encrypt ( plainText , associatedDataString , nonce ) , Convert . ToBase64String ( nonce ) ) ; }
Encrypt a given plain text and add associated data.
Encrypt a given plain text and add associated data .
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
associatedDataString
string
max. 16 character long string (not secret)
max . 16 character long string ( not secret )