Crypto Laser

Simple, cross-platform library for symmetric authenticated encryption.

key = SecureRandom.random_bytes(64)
cipher_text = CryptoLaser.encrypt(key, "my secret message")
plain_text = CryptoLaser.decrypt(key, cipher_text)

Note that the key must be a raw byte array exactly 64 bytes long. The cipher texts returned by encrypt are Base64-encoded.

The heavy lifting is done by Ruby's OpenSSL, so we use AES-256-CBC as the cipher and HMAC-SHA-256 as the MAC. These algorithms should be available on all Ruby 1.9 installations (including those on OS X, Windows, and Linux).

alt text