Module: EncryptDecrypt

Included in:
DocIntegrityCheck
Defined in:
lib/encrypt_decrypt.rb

Overview

Handles encryption and decryption of files

Instance Method Summary collapse

Instance Method Details

#decrypt(data) ⇒ Object

Decrypt data



12
13
14
15
# File 'lib/encrypt_decrypt.rb', line 12

def decrypt(data)
  crypto = GPGME::Crypto.new
  return crypto.decrypt(data).to_s
end

#encrypt_data(file_obj, recipient) ⇒ Object

Encrypt file



6
7
8
9
# File 'lib/encrypt_decrypt.rb', line 6

def encrypt_data(file_obj, recipient)
  crypto = GPGME::Crypto.new
  return crypto.encrypt(file_obj, recipients: recipient, armor: true)
end