-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
99fc76e
commit ef14ba9
Showing
2 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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=') | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |