Sha256: 1f72838e63539217e995131fb4117e22b9da5fa5b4048650d9d912cf13715023

Contents?: true

Size: 396 Bytes

Versions: 27

Compression:

Stored size: 396 Bytes

Contents

# coding: utf-8
module Reapal
  module Encrypt
    module RSA

      def self.encrypt(content, public_key)
        content_str = public_key.public_encrypt(content)
        Base64.strict_encode64(content_str)
      end

      def self.decrypt(content, private_key)
        content_str = Base64.strict_decode64(content)
        private_key.private_decrypt(content_str)
      end

    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
reapal-0.9.1 lib/reapal/encrypt/rsa.rb
reapal-0.9.0 lib/reapal/encrypt/rsa.rb
reapal-0.3.0 lib/reapal/encrypt/rsa.rb
reapal-0.2.2 lib/reapal/encrypt/rsa.rb
reapal-0.2.1 lib/reapal/encrypt/rsa.rb
reapal-0.2.0 lib/reapal/encrypt/rsa.rb
reapal-0.1.0 lib/reapal/encrypt/rsa.rb