Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compute AES128 CMAC with openssl as command line

I'am looking for a tool that can compute a AES128 CMAC as a command line. Openssl does not seem to offer this feature with the command line. Did I miss something, or do you know a command line tool that can perform this computation?

like image 706
Tom97531 Avatar asked Aug 26 '11 15:08

Tom97531


2 Answers

Using newer OpenSSL (1.0.1 I think), you could do:

openssl dgst -mac cmac -macopt cipher:aes-128-cbc -macopt hexkey:11223344556677889900112233445566 -sha1 <file>

Choose the cipher with -macopt cipher:<cipher> option and the hash with -<hash>.

like image 168
Yann Droneaud Avatar answered Sep 25 '22 14:09

Yann Droneaud


[sweep over old questions]

Looked in source of openssl, but could not find it either. There is a patch available for openssl (search for peter, ibm and openssl) but you will have to test it against the latest and rebuild. OpenSSL is a very useful but horribly maintained library/tool.

If there is another tool that does AES/CMAC, it's very good at hiding as well.

like image 32
Maarten Bodewes Avatar answered Sep 21 '22 14:09

Maarten Bodewes