class
ActiveRecord::Encryption::Cipher
- ActiveRecord::Encryption::Cipher
- Reference
- Object
Defined in:
active_record/encryption/cipher.crConstant Summary
-
CIPHER_TYPE =
"aes-256-gcm" -
IV_LENGTH =
12 -
https://github.com/rails/rails/blob/885734a85ef4f4578400bda72a7507dd09a85e64/activerecord/lib/active_record/encryption/cipher/aes256_gcm.rb#L95
Constructors
Instance Method Summary
- #decrypt(encrypted_message)
-
#encrypt(clear_text, deterministic = false)
Ported from https://github.com/rails/rails/blob/main/activerecord/lib/active_record/encryption/cipher/aes256_gcm.rb https://docs.openssl.org/1.1.1/man3/EVP_EncryptInit/#synopsis cipher = OpenSSL::Cipher.new("aes-256-gcm") cipher.encrypt cipher.key = "1"*32 iv = "1" * 12 data = cipher.update("foo") data << cipher.final p cipher.auth_tag
- #generate_deterministic_iv(clear_text)
- #generate_iv(cipher, clear_text, deterministic)
Constructor Detail
Instance Method Detail
Ported from https://github.com/rails/rails/blob/main/activerecord/lib/active_record/encryption/cipher/aes256_gcm.rb https://docs.openssl.org/1.1.1/man3/EVP_EncryptInit/#synopsis cipher = OpenSSL::Cipher.new("aes-256-gcm") cipher.encrypt cipher.key = "1"*32 iv = "1" * 12 data = cipher.update("foo") data << cipher.final p cipher.auth_tag