Sha256: 97bf1173afe9b59fdf1762a53755abfc65ba86dc73978ef914ac1f060123bb92

Contents?: true

Size: 557 Bytes

Versions: 1

Compression:

Stored size: 557 Bytes

Contents

require 'helper'

class TestAES < Test::Unit::TestCase
    
  should "encrypt and decrypt a string" do
    key = "01234567890123456789012345678901"
    msg = "This is a message that nobody should ever see"
    enc = AES.encrypt(key, msg)
    assert_equal msg, AES.decrypt(key, enc)
    enc = AES.encrypt(key, msg, {:format => :plain})
    assert_equal msg, AES.decrypt(key, enc, {:format => :plain})
  end
  
  should "generate a new key when AES#key" do
    assert_equal 32, AES.key.length
    assert_equal 45, AES.key(256, :base_64).length
  end
    
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
aes-0.3.0 test/test_aes.rb