Skip to content

Commit

Permalink
Use old behavior of attr_encrypted
Browse files Browse the repository at this point in the history
  • Loading branch information
dchapman1988 committed Jan 5, 2018
1 parent 99fc76e commit ef14ba9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
7 changes: 7 additions & 0 deletions config/initializers/encryptor.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Encryptor.default_options.merge!(
algorithm: 'aes-256-cbc',
insecure_mode: true
#key: Base64.decode64('Is995f6zy+tKE4/tnCG73I7XzNAiFNWQBdBDmzEb6OI='),
#iv: Base64.decode64('FOIbqxLbDwh4P+d9'),
#salt: Base64.decode64('0zUIh/CiVIE3ERfl8Z4F1YjWYlvvUIf21B0tL0QrBxMKKEK9R1Hs992hLp7AMOqy0USY99TndZekUv+vAcy+rKakMio0KlvmU/oWgreTOBE3nDYoPoxSKmGtkQLP7lXZkBlkd5/5YhgiMjP8cYgv+L9PZMRLEiUgh8AIRUGNkm4=')
)
13 changes: 13 additions & 0 deletions lib/tasks/openssl.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace :openssl do
desc "Generate Base64 encoded bytes for application.yml"
task generate: :environment do
{
ENCRYPT_SECRET_KEY: 32,
ENCRYPT_IV: 12,
ENCRYPT_SALT: 128
}.each do |k, length|
value = Base64.encode64(SecureRandom.random_bytes(length)).delete("\n")
puts "#{k}: '#{value}'"
end
end
end

0 comments on commit ef14ba9

Please sign in to comment.