Note: It's 2019 and if you're looking for a modern and actively maintained Ruby encryption library you should do yourself a favor and check out RbNaCl, which is based on LibSodium. The code below was designed purely for demonstration purposes and should not be used in applications where serious crypto is needed.
A demonstration of SJCL AES-CCM in pure Ruby.
Defaults to 256 bit AES in CCM mode with 100_000 iterations PBKDF2
enc = SJCL.encrypt('password', "Something to encrypt")
dec = SJCL.decrypt('password', enc)
# Custom number of PBKDF2 iterations
enc = SJCL.encrypt('password', "Something to encrypt", {:iter => 10_000})
dec = SJCL.decrypt('password', enc)
- Should be 100% compatible with SJCL Javascript library in AES-CCM mode
- Written in pure ruby
- Test interop with node module directly
- 1.0.1
- Match comparison fucntion from SJCL js
- Include SJCL version in JSON
- Better errors thrown
- Update docs
- 1.0.0
- Update to use OpenSSL PBKDF2 function for increased speed
- Increase default iterations to 100,000