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.18.0 lib/reapal/encrypt/rsa.rb
reapal-0.17.0 lib/reapal/encrypt/rsa.rb
reapal-0.16.0 lib/reapal/encrypt/rsa.rb
reapal-0.15.0 lib/reapal/encrypt/rsa.rb
reapal-0.14.0 lib/reapal/encrypt/rsa.rb
reapal-0.13.0 lib/reapal/encrypt/rsa.rb
reapal-0.12.0 lib/reapal/encrypt/rsa.rb
reapal-0.11.0 lib/reapal/encrypt/rsa.rb
reapal-0.10.1 lib/reapal/encrypt/rsa.rb
reapal-0.10.0 lib/reapal/encrypt/rsa.rb
reapal-0.9.13 lib/reapal/encrypt/rsa.rb
reapal-0.9.12 lib/reapal/encrypt/rsa.rb
reapal-0.9.11 lib/reapal/encrypt/rsa.rb
reapal-0.9.10 lib/reapal/encrypt/rsa.rb
reapal-0.9.9 lib/reapal/encrypt/rsa.rb
reapal-0.9.7 lib/reapal/encrypt/rsa.rb
reapal-0.9.6 lib/reapal/encrypt/rsa.rb
reapal-0.9.5 lib/reapal/encrypt/rsa.rb
reapal-0.9.3 lib/reapal/encrypt/rsa.rb
reapal-0.9.2 lib/reapal/encrypt/rsa.rb