Project

cmac-rb

0.0
No release in over 3 years
Low commit activity in last 3 years
Ruby C extension for the AES-CMAC keyed hash function.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

>= 0
~> 2.12.0
 Project Readme

cmac-rb

This gem implements the CMAC keyed hash function as described in RFC 4493. The CMAC function is written as a low-level C extension on top of OpenSSL, for speed and compatibility.

AES-CMAC provides stronger assurance of data integrity than a checksum or an error-detecting code. The verification of a checksum or an error-detecting code detects only accidental modifications of the data, while CMAC is designed to detect intentional, unauthorized modifications of the data, as well as accidental modifications.

AES-CMAC achieves a security goal similar to that of HMAC. Since AES-CMAC is based on a symmetric key block cipher, AES, and HMAC is based on a hash function, such as SHA-1, AES-CMAC is appropriate for information systems in which AES is more readily available than a hash function.

Warning: this package should not be considered cryptographically secure.

Install

gem install cmac-rb

Usage

require 'cmac-rb'

digest = CMAC::Digest.new(key)
tag = digest.update(plaintext)

Reference

License

This program is released under the GNU Affero General Public License.