Sha256: af0d3612da29cdab87a93f14b0768ae5b64e149aad5d47a09d8dfb1e6f8775e6

Contents?: true

Size: 348 Bytes

Versions: 1

Compression:

Stored size: 348 Bytes

Contents

require 'enigma_decrypter/version'
require 'openssl'
require 'base64'

module EnigmaDecrypter
  def self.decrypt(encrypted_key, private_key)
    return nil if encrypted_key.to_s.empty? || private_key.to_s.empty?
    rsa_private_key = OpenSSL::PKey::RSA.new(private_key)
    rsa_private_key.private_decrypt(Base64.decode64(encrypted_key))
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
enigma_decrypter-0.1.0 lib/enigma_decrypter.rb