Class: Rgc::Clean
Instance Method Summary collapse
- #encrypt(content) ⇒ Object
-
#initialize(global_options, options, args) ⇒ Clean
constructor
A new instance of Clean.
Methods included from KeyFile
Constructor Details
#initialize(global_options, options, args) ⇒ Clean
Returns a new instance of Clean.
5 6 7 8 9 |
# File 'lib/rgc/clean.rb', line 5 def initialize(, , args) load_key print(encrypt(ARGF.read)) end |
Instance Method Details
#encrypt(content) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/rgc/clean.rb', line 11 def encrypt(content) @aes = OpenSSL::Cipher.new("AES-128-CBC") @aes.encrypt @aes.key = @key # TODO: consinder to set @aes.iv Base64.encode64(@aes.update(content) + @aes.final) end |