Skip to content

Instantly share code, notes, and snippets.

@eprothro
Created January 8, 2018 18:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eprothro/55fb98feee31757382ed24ac0fd8b04e to your computer and use it in GitHub Desktop.
Save eprothro/55fb98feee31757382ed24ac0fd8b04e to your computer and use it in GitHub Desktop.
require 'openssl'
require 'base64'
cipher = OpenSSL::Cipher::Cipher.new("aes-256-cbc")
key = cipher.random_key
value = Base64.strict_encode64(key)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment