summaryrefslogtreecommitdiff
path: root/spec/support/crypto.rb
blob: 7484f260819b18ca2b8920488f9abce45947b835 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
require 'openssl'

class Crypto
  def initialize(key = nil)
    @key = key
  end

  def encrypt(plain_text)
    @key.public_encrypt(plain_text)
  end

  def decrypt(cipher_text)
    @key.private_decrypt(cipher_text)
  end
end