Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​Security.​Cryptography.​ChaCha20Poly1305

Assembly: System.Security.Cryptography

Inheritance: object → ChaCha20Poly1305

Implemented Interfaces

Represents a symmetric key to be used with the ChaCha20 stream cipher in the combined mode with the Poly1305 authenticator.

Properties

public static bool
IsSupported
Gets a value that indicates whether the algorithm is supported on the current platform.

Methods

public void
Decrypt​(byte[] nonce, byte[] ciphertext, byte[] tag, byte[] plaintext, byte[] associatedData = null)
Decrypts the ciphertext into the provided destination buffer if the authentication tag can be validated.
nonce The nonce associated with this message, which must match the value provided during encryption.
ciphertext The encrypted content to decrypt.
tag The authentication tag produced for this message during encryption.
plaintext The byte array to receive the decrypted contents.
associatedData Extra data associated with this message, which must match the value provided during encryption.
public void
Decrypt​(ReadOnlySpan<​byte> nonce, ReadOnlySpan<​byte> ciphertext, ReadOnlySpan<​byte> tag, Span<​byte> plaintext, ReadOnlySpan<​byte> associatedData = null)
Decrypts the ciphertext into the provided destination buffer if the authentication tag can be validated.
nonce The nonce associated with this message, which must match the value provided during encryption.
ciphertext The encrypted content to decrypt.
tag The authentication tag produced for this message during encryption.
plaintext The byte array to receive the decrypted contents.
associatedData Extra data associated with this message, which must match the value provided during encryption.
public void
Dispose​()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void
Encrypt​(byte[] nonce, byte[] plaintext, byte[] ciphertext, byte[] tag, byte[] associatedData = null)
Encrypts the plaintext into the ciphertext destination buffer and generates the authentication tag into a separate buffer.
nonce The nonce associated with this message, which should be a unique value for every operation with the same key.
plaintext The content to encrypt.
ciphertext The byte array to receive the encrypted contents.
tag The byte array to receive the generated authentication tag.
associatedData Extra data associated with this message, which must also be provided during decryption.
public void
Encrypt​(ReadOnlySpan<​byte> nonce, ReadOnlySpan<​byte> plaintext, Span<​byte> ciphertext, Span<​byte> tag, ReadOnlySpan<​byte> associatedData = null)
Encrypts the plaintext into the ciphertext destination buffer and generates the authentication tag into a separate buffer.
nonce The nonce associated with this message, which should be a unique value for every operation with the same key.
plaintext The content to encrypt.
ciphertext The byte array to receive the encrypted contents.
tag The byte array to receive the generated authentication tag.
associatedData Extra data associated with this message, which must also be provided during decryption.
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
public Type
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object