Method: Krypton::AESCrypt.encrypt

Defined in:
lib/core/aes.rb

.encrypt(message, password, outfile = '') ⇒ Object

Taken from github.com/Gurpartap/aescrypt/blob/master/lib/aescrypt.rb and improved for newew ruby versions



8
9
10
11
12
# File 'lib/core/aes.rb', line 8

def self.encrypt(message, password, outfile='')
  a = Base64.encode64(self.encrypt_data(message.to_s.strip, self.key_digest(password), nil, "AES-256-CBC"))
  File.write(outfile, a) unless outfile == '' || outfile.nil?
  a
end