Sha256: 7a4f9b4ab5bf3d136cc3326495150a7139ee71b263dc24122838a1077e6148b5

Contents?: true

Size: 414 Bytes

Versions: 3

Compression:

Stored size: 414 Bytes

Contents

# coding: utf-8

module JytPay
  module Encrypt
    module Rsa

      def self.encrypt(rsa_public_key, key_arg = Encrypt::DES_KEY)
        data = [key_arg].pack 'H*'
        kenc = rsa_public_key.public_encrypt key_arg
        kenc.unpack('H*')[0]
      end

      def self.decrypt(key_enc, rsa_private_key)
        ec = [key_enc].pack 'H*'
        rsa_private_key.private_decrypt(ec)
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
jyt_pay-0.3.0 lib/jyt_pay/encrypt/rsa.rb
jyt_pay-0.2.0 lib/jyt_pay/encrypt/rsa.rb
jyt_pay-0.1.0 lib/jyt_pay/encrypt/rsa.rb