class
ActiveSupport::KeyGenerator
- ActiveSupport::KeyGenerator
- Reference
- Object
Overview
A simple wrapper around OpenSSL's PBKDF2 implementation.
KeyGenerator derives keys from a secret using PBKDF2-HMAC. Different salts can be used to derive multiple independent keys from the same secret.
This is a minimal implementation compatible with ActiveSupport::KeyGenerator from Rails: https://api.rubyonrails.org/classes/ActiveSupport/KeyGenerator.html
It is primarily used for compatibility with ActiveStorage::Blob and ActiveRecord::Encryption.
Defined in:
active_support/key_generator.crConstructors
- .instance : self
- .new(secret : String, hash_digest : OpenSSL::Algorithm = OpenSSL::Algorithm::SHA256, iterations : Int32 = 2 ** 16)
Class Method Summary
Instance Method Summary
Constructor Detail
def self.new(secret : String, hash_digest : OpenSSL::Algorithm = OpenSSL::Algorithm::SHA256, iterations : Int32 = 2 ** 16)
#