class NaCl::AEAD::XChaCha20Poly1305

Overview

The XChaCha20-Poly1305 construction can safely encrypt a practically unlimited number of messages with the same key, without any practical limit to the size of a message (up to ~ 2^64 bytes).

As an alternative to counters, its large nonce size (192-bit) allows random nonces to be safely used.

For this reason, and if interoperability with other libraries is not a concern, this is the recommended AEAD construction.

For documentation on all AEAD methods, see AEAD::Base.

Defined in:

nacl/aead/xchacha20poly1305_ietf.cr

Class Method Summary

Instance Method Summary

Instance methods inherited from class NaCl::AEAD::Base

decrypt(nonce, ciphertext, additional_data = nil) decrypt, decrypt_string(nonce, ciphertext, additional_data = nil, encoding = "utf8") decrypt_string, do_decrypt(message, message_len, nonce, ciphertext, additional_data) do_decrypt, do_encrypt(ciphertext, ciphertext_len, nonce, message, additional_data) do_encrypt, encrypt(nonce, message, additional_data = nil) encrypt, encrypt_string(nonce, message, additional_data = nil) encrypt_string, key : Indexable(UInt8) key, key_bytes key_bytes, nonce_bytes nonce_bytes, tag_bytes tag_bytes

Constructor methods inherited from class NaCl::AEAD::Base

new(key : Indexable(UInt8)) new

Class methods inherited from class NaCl::AEAD::Base

key_bytes key_bytes, nonce_bytes nonce_bytes, tag_bytes tag_bytes

Class Method Detail

def self.keygen #

[View source]

Instance Method Detail

def do_decrypt(message, message_len, nonce, ciphertext, additional_data = nil) #

[View source]
def do_encrypt(ciphertext, ciphertext_len, nonce, message, additional_data = nil) #

[View source]