repository-secrets.rb
def decrypt(keypath, ciphertext)
  verbose 3, "decrypt(\"#{keypath}\", \"#{ciphertext}\")"
  private_key=OpenSSL::PKey::RSA.new(File.read(keypath))
  plaintext=private_key.private_decrypt(Base64.strict_decode64(ciphertext))
  verbose 3, "  returns \"#{plaintext}\""
  return plaintext
end
#First decodes base64 cipher text input and then decrypts; returns plain text
First decodes base64 cipher text input and then decrypts; returns plain text
First decodes base64 cipher text input and then decrypts ; returns plain text
def decrypt(keypath, ciphertext)
  verbose 3, "decrypt(\"#{keypath}\", \"#{ciphertext}\")"
  private_key=OpenSSL::PKey::RSA.new(File.read(keypath))
  plaintext=private_key.private_decrypt(Base64.strict_decode64(ciphertext))
  verbose 3, "  returns \"#{plaintext}\""
  return plaintext
end
def decrypt ( keypath , ciphertext ) verbose 3 , "decrypt(\"#{keypath}\", \"#{ciphertext}\")" private_key = OpenSSL :: PKey :: RSA . new ( File . read ( keypath ) ) plaintext = private_key . private_decrypt ( Base64 . strict_decode64 ( ciphertext ) ) verbose 3 , "  returns \"#{plaintext}\"" return plaintext end
First decodes base64 cipher text input and then decrypts; returns plain text
First decodes base64 cipher text input and then decrypts ; returns plain text
keypath
ciphertext