abstract class NaCl::AEAD::Base
- NaCl::AEAD::Base
- Reference
- Object
Direct Known Subclasses
Defined in:
nacl/aead/base.crConstant Summary
-
ABYTES =
LibSodium::CRYPTO_AEAD_XCHACHA20POLY1305_IETF_ABYTES
-
KEYBYTES =
LibSodium::CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES
-
MESSAGEBYTES_MAX =
LibSodium::CRYPTO_AEAD_XCHACHA20POLY1305_IETF_MESSAGEBYTES_MAX
-
NPUBBYTES =
LibSodium::CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES
-
NSECBYTES =
LibSodium::CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NSECBYTES
Constructors
Class Method Summary
-
.key_bytes
The key bytes for the AEAD class
-
.nonce_bytes
The nonce bytes for the AEAD class
-
.tag_bytes
The number bytes in the tag or authenticator from this AEAD class
Instance Method Summary
-
#decrypt(nonce, ciphertext, additional_data = nil)
Decrypts and verifies an encrypted message with additional authenticated data
-
#decrypt_string(nonce, ciphertext, additional_data = nil, encoding = "utf8")
Same as
#decrypt
, but returns aString
- #do_decrypt(message, message_len, nonce, ciphertext, additional_data)
- #do_encrypt(ciphertext, ciphertext_len, nonce, message, additional_data)
-
#encrypt(nonce, message, additional_data = nil)
Encrypts and authenticates a message with additional authenticated data
-
#encrypt_string(nonce, message, additional_data = nil)
Same as
#encrypt
, but accepts aString
message - #key : Indexable(UInt8)
-
#key_bytes
The key bytes for the AEAD instance
-
#nonce_bytes
The nonce bytes for the AEAD instance
-
#tag_bytes
The number of bytes in the tag or authenticator for this AEAD instance
Constructor Detail
Class Method Detail
Instance Method Detail
def decrypt(nonce, ciphertext, additional_data = nil)
#
Decrypts and verifies an encrypted message with additional authenticated data
Same as #decrypt
, but returns a String
abstract
def do_encrypt(ciphertext, ciphertext_len, nonce, message, additional_data)
#
def encrypt(nonce, message, additional_data = nil)
#
Encrypts and authenticates a message with additional authenticated data
def encrypt_string(nonce, message, additional_data = nil)
#
Same as #encrypt
, but accepts a String
message