Based on cane gem, removed tab indents and trailing blanks

This commit is contained in:
Al Snow
2015-09-14 10:11:03 -04:00
parent 6bacc8522c
commit b6d766329c
7 changed files with 50 additions and 50 deletions
+7 -7
View File
@@ -1,5 +1,5 @@
module Encryption
# Added a re-usable encryption routine, shouldn't be an issue!
def self.encrypt_sensitive_value(val="")
aes = OpenSSL::Cipher::Cipher.new(cipher_type)
@@ -9,7 +9,7 @@ module Encryption
new_val = aes.update("#{val}") + aes.final
Base64.strict_encode64(new_val).encode('utf-8')
end
def self.decrypt_sensitive_value(val="")
aes = OpenSSL::Cipher::Cipher.new(cipher_type)
aes.decrypt
@@ -18,19 +18,19 @@ module Encryption
decoded = Base64.strict_decode64("#{val}")
aes.update("#{decoded}") + aes.final
end
# Should be able to just re-use the same key we already have!
def self.key
raise "Key Missing" if !(KEY)
KEY
end
def self.iv
RG_IV
end
def self.cipher_type
'aes-256-cbc'
end
end
end