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