SmallLars / openssl-ccm

Ruby Gem for RFC 3610 - Counter with CBC-MAC (CCM)
rubygems.org/gems/openssl-ccm
MIT License
2 stars 6 forks source link

Gem Version Dependency Status Build Status Coverage Status Code Climate Inline docs

openssl-ccm

Ruby Gem for RFC 3610 - Counter with CBC-MAC (CCM)

Installation

Add this line to your application's Gemfile:

gem 'openssl-ccm'

And then execute:

$ bundle

Or install it yourself as:

$ gem install openssl-ccm

Usage

Example:

require 'openssl/ccm'
ccm = OpenSSL::CCM.new('AES', 'My16Byte LongKey', 8)
ciphertext = ccm.encrypt('The message to encrypt', 'The nonce')
plaintext = ccm.decrypt(ciphertext, 'The nonce')

After initialisation, you can use the object as often you need.