ActiveSupport::KeyGenerator < Object — A simple wrapper around OpenSSL's PBKDF2 implementation for deriving multiple keys from a single secret.
Source: /home/chedong/.local/share/rdoc
| Use Case | Command | Description |
|---|---|---|
| Create a new key generator | ActiveSupport::KeyGenerator.new(secret, options = {}) | Initialize a generator with a master secret and optional hash digest/iterations |
| Generate a derived key | generator.generate_key(salt, key_length = 64) | Derive a key of specified length using PBKDF2 with the given salt |
KeyGenerator is a simple wrapper around OpenSSL's implementation of PBKDF2. It can be used to derive a number of keys for various purposes from a given secret. This lets Rails applications have a single secure secret, but avoid reusing that key in multiple incompatible contexts.
new — Constructor for creating a new KeyGenerator instancegenerate_key — Derive a key from the secret using a salt and optional lengthGenerated by phpman v4.9.26-1-g511901d · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-27 18:51 @216.73.216.199
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format