Generates a random 32-byte encryption key for use with MetamorphicCrypto.
$ mix metamorphic_crypto.gen.key
The output is a base64-encoded key suitable for:
config :metamorphic_crypto, :secret_key(Ecto encrypted fields)config :metamorphic_crypto, :hmac_key(blind indexes)- Any
MetamorphicCrypto.SecretBoxoperation
Options
--countor-n— number of keys to generate (default: 1)
Example
$ mix metamorphic_crypto.gen.key
Generated key:
xK7m2Fq9+PnNz3v...
Add to your config/runtime.exs:
config :metamorphic_crypto, :secret_key, System.fetch_env!("METAMORPHIC_CRYPTO_KEY")