Module: RailsCredentialsGit

Defined in:
lib/rails-credentials-git.rb,
lib/rails-credentials-git/cli.rb,
lib/rails-credentials-git/version.rb

Defined Under Namespace

Classes: CLI

Constant Summary collapse

VERSION =
"0.1.1"
@@method =
<<~RUBY
  def self.decrypt(content, key)
    encrypted_data, iv, auth_tag = content.split("--").map { |v| ::Base64.strict_decode64(v) }
    secret = [key].pack("H*")
     cipher = OpenSSL::Cipher.new("aes-128-gcm")
    cipher.decrypt
    cipher.key = secret
    cipher.iv  = iv
    cipher.auth_tag = auth_tag
    cipher.auth_data = ""
     decrypted_data = cipher.update(encrypted_data)
    decrypted_data << cipher.final
     Marshal.load(decrypted_data)
  end
RUBY

Class Method Summary collapse

Class Method Details

.decrypt_methodObject



24
25
26
# File 'lib/rails-credentials-git.rb', line 24

def self.decrypt_method
  @@method
end