Compute AES128 CMAC with openssl as command line

7.9k Views Asked by At

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?

2

There are 2 best solutions below

0
On

[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.

1
On

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>.