Sha256: c4115a3327da1e16312148e79b84212670a151a32ae24695fa7fe0bdd99731c6

Contents?: true

Size: 689 Bytes

Versions: 2

Compression:

Stored size: 689 Bytes

Contents

require 'spec_helper'

describe "the aes cipher" do

  before do
    @cipher = Gibberish::AES.new("password")
  end

  it "should encrypt text and be compatible with OpenSSL CLI" do
    secret_text = "Made with Gibberish"
    encrypted = @cipher.e(secret_text)
    from_openssl = `echo "#{encrypted}" | openssl enc -d -aes-256-cbc -a -k password`
    from_openssl.should eql(secret_text)
  end

  it "should decrypt base64 encoded data from the OpenSSL CLI" do
    secret_text = "Made with Gibberish"
    from_openssl = `echo #{secret_text} | openssl enc -aes-256-cbc -a -k password`
    decrypted_text = @cipher.d(from_openssl).chomp
    decrypted_text.should eql(secret_text)
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gibberish-0.0.2 spec/aes_spec.rb
gibberish-0.0.1 spec/aes_spec.rb