Class: AEAD::Cipher::AES_256_CBC_HMAC_SHA_256
Overview
Encrypt plaintext using the CBC mode of AES and authenticate the
result with HMAC-SHA-256.
Class Method Summary
collapse
Methods included from AES_HMAC
#initialize
#decrypt, #encrypt, generate_key, #key_len, new, #nonce_len, signature_compare
Class Method Details
.cipher_mode ⇒ Object
21
|
# File 'lib/aead/cipher/aes_256_cbc_hmac_sha_256.rb', line 21
def self.cipher_mode; 'aes-256-cbc'; end
|
.digest_mode ⇒ Object
22
|
# File 'lib/aead/cipher/aes_256_cbc_hmac_sha_256.rb', line 22
def self.digest_mode; 'SHA256'; end
|
.encryption_key_len ⇒ Object
18
|
# File 'lib/aead/cipher/aes_256_cbc_hmac_sha_256.rb', line 18
def self.encryption_key_len; 32; end
|
.generate_nonce ⇒ Object
CBC requires a randomly-generated nonce.
27
28
29
|
# File 'lib/aead/cipher/aes_256_cbc_hmac_sha_256.rb', line 27
def self.generate_nonce
SecureRandom.random_bytes(self.nonce_len)
end
|
.iv_len ⇒ Object
14
|
# File 'lib/aead/cipher/aes_256_cbc_hmac_sha_256.rb', line 14
def self.iv_len; 16; end
|
.key_len ⇒ Object
13
|
# File 'lib/aead/cipher/aes_256_cbc_hmac_sha_256.rb', line 13
def self.key_len; 64; end
|
.nonce_len ⇒ Object
15
|
# File 'lib/aead/cipher/aes_256_cbc_hmac_sha_256.rb', line 15
def self.nonce_len; 16; end
|
.signing_key_len ⇒ Object
19
|
# File 'lib/aead/cipher/aes_256_cbc_hmac_sha_256.rb', line 19
def self.signing_key_len; 32; end
|
.tag_len ⇒ Object
16
|
# File 'lib/aead/cipher/aes_256_cbc_hmac_sha_256.rb', line 16
def self.tag_len; 32; end
|