Questions tagged [cmac]

In cryptography, CMAC is a MAC (message authentication code) based on a block cipher such as AES

CMAC is a MAC based on a block cipher such as AES. It is also known as OMAC1. CMAC's design is similar to , but CMAC avoids the flaws of CBC-MAC that make it fragile.

Not to be confused with the CMAC neural network (cerebellar model articulation controller).

Standards

23 questions
11
votes
2 answers

Authentication tips using NTAG 424 DNA TT

I need to implement an authentication procedure between a reader an NFC tag but being my knowledge limited in this area I will appreciated some aid in order to understand few concepts. Pardon in advance for rewrite the Bible but I could not…
user67441
  • 111
  • 1
  • 3
7
votes
2 answers

CMAC Key generation with OpenSSL EVP_DigestSign* fails

I am trying to generate key for computing the CMAC with OpenSSL. However, these seem to fail with the error message copied below. Can someone point out where the problem is? Has anybody done CMAC with EVP_DigestSign* calls? Here is part of the code…
user489152
  • 907
  • 1
  • 23
  • 42
5
votes
2 answers

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?
Tom97531
  • 512
  • 7
  • 14
5
votes
1 answer

How to use Bouncycastle's CMac

I'm trying to use BouncyCastle's CMac implementation but apparently I'm doing it wrong. At least the following unit test (based on RFC 5297 test vectors) fails: @Test public void testCMacOfZeros() { byte[] key = {(byte) 0xff, (byte) 0xfe, (byte)…
Sebastian S
  • 4,420
  • 4
  • 34
  • 63
5
votes
2 answers

How can I generate CMAC-AES in javascript

I am attempting to use the Stanford Javascript Crypto Library to generate an CMAC-AES token for an OAuth 2.0 assertion, but I'm far from being an expert with cryptography. Can someone give an example using sjcl or any open-license js library out…
LilPickle3000
  • 310
  • 1
  • 2
  • 11
4
votes
3 answers

CMAC why K1 and K2

http://en.wikipedia.org/wiki/CMAC http://www.rfc-archive.org/getrfc.php?rfc=4493 There are two keys K1 and K2. Are there any other reasons, beside that messages 1 differs from 10^127 (1 and 127 zeroes) If message carries length (and length is also…
Luka Rahne
  • 10,336
  • 3
  • 34
  • 56
4
votes
1 answer

CMAC-AES hashing with PHP

Our API platform using CMAC-AES hashes as the signature for a request. We have libraries available for creating this hash in Java and .NET but need to find a solution for PHP as well. Problem is I can't find anything that seems to reliably generate…
Jeof
  • 99
  • 8
3
votes
1 answer

AES-CMAC in Java Card

Is there a proper way of doing an AES CMAC encryption in Java Cards? After researching I've hit a roadblock wherein I cannot find any example or samples of Java card that has AES CMAC encryption. Is there any way or at least is it possible to do an…
Jujumancer
  • 125
  • 1
  • 12
3
votes
1 answer

AES CMAC Calculation C#

I know MAC is 4 first byte of last block encryption, and found this CMAC explanation here but it's kinda hard to understand. And maybe there are already some CMAC AES questions but I'm sorry I can't understand it well. Anyone can explain how to…
2
votes
1 answer

aes-cmac in javascript not giving the same results as in python

I'm writing code to read/write to NTAG424 DNA NFC tags. I'm doing this completely in javascript, because I want to be able to use it in a react native app. In NTAG 424 DNA and NTAG 424 DNA TagTamper features and hints they show the results you…
Zen Zac
  • 136
  • 1
  • 9
2
votes
0 answers

When reprogramming memory / Key for a SHE module, a correct M3 is not generated from M1||M2

I need to generate M1, M2, and M3 in order to reprogram a security key within a SHE module. I have verified that both my AES_128_ECB function, as well as my CMAC function are working properly against NIST test vectors. I am also able to generate M1…
Jordan
  • 37
  • 3
2
votes
1 answer

AES-CMAC using mbedtls: undefined reference error

I try to implement AES-CMAC using mbedTLS. I get some errors: undefined reference to mbedtls_cipher_cmac_starts, undefined reference to mbedtls_cipher_cmac_update, undefined reference to mbedtls_cipher_cmac_finish, Why could these functions not be…
malievci
  • 369
  • 1
  • 2
  • 6
2
votes
1 answer

CMAC-AES on iOS

I'm converting an Android app to iOS. The Android version uses CMAC-AES cryptography, but I couldn't find CMAC for iOS. Does anyone know a library or could give a tip? I am not familiar with cryptography, so I am little messy.
lhmgrassi
  • 131
  • 2
  • 6
2
votes
1 answer

How to calculate AES CMAC using OpenSSL's CMAC_xxx functions?

Is there any way to compute AES CMAC with OpenSSL/libcrypto? Preferably in a way that takes advantage of AES-NI (or any other hardware acceleration). See also CMAC Key generation with OpenSSL EVP_DigestSign* fails
RubenLaguna
  • 21,435
  • 13
  • 113
  • 151
1
vote
1 answer

libgcrypt: Is CMAC an option?

Working with libgcrypt for a project, using the following settings to open a cipher handle: GCRY_CIPHER_AES256, GCRY_CIPHER_MODE_GCM, GCRY_CIPHER_CBC_MAC Per the libgcrypt documentation: GCRY_CIPHER_CBC_MAC: Compute CBC-MAC keyed checksums. This is…
Ramrod
  • 378
  • 7
  • 18
1
2