Questions tagged [cbc-mac]

CBC-MAC is a chaining mode to compute a signature using a secret key with a cblock cipher.

CBC-MAC is a chaining mode to compute a cryptographic signature (specifically, a message authentication code) using a secret key with a block cipher such as AES.

CBC-MAC is MAC algorithm 1 in ISO/IEC 9797-1. DES/CBC-MAC is DAA in FIPS 113 (retired).

CMAC (also known as OMAC-1) is a variant of CBC-MAC specified by FIPS 800-38B.

23 questions
10
votes
3 answers

ISO 9797-1 Algorithm 1 [CBC-MAC] in C#

It seems that there're 6 variations to CBC-MAC algorithm. I've been trying to match the MAC algorithm on the PINPad 1000SE [which per manual is ISO 9797-1 Algorithm 1]. I got an excellent start from here. And I coded the algorithm as below: public…
Vyas Bharghava
  • 6,372
  • 9
  • 39
  • 59
6
votes
2 answers

Using one key for Encryption and HMAC

I am wondering whether I can use a shared secret key established between two clients as the HMAC key too. I saw that there is a problem when it is used as a CBC-MAC but I haven't found any evidence it is bad practice for HMACs. Thanks, Vladimir
Vladimir
  • 417
  • 5
  • 20
3
votes
1 answer

Compute the CBC-MAC with AES-256 and openssl in C

I want to compute the CBC-MAC of a given plaintext with openssl. I have the following plaintext (hexdump): hexdump -C example.txt 00000000 4d 41 43 73 20 61 72 65 20 76 65 72 79 20 75 73 |MACs are very us| 00000010 65 66 75 6c 20 69 6e 20 63 72…
izlin
  • 2,129
  • 24
  • 30
3
votes
1 answer

AES cipher in GCM, CCM, or CBC-MAC mode?

I've been looking around for an article describing these modes in layman's terms but have not yet found anything helpful. So, what are the positives and negatives of each mode? Thanks GCM CCM CBC-MAC
crawfish
  • 853
  • 4
  • 11
  • 14
2
votes
2 answers

How can I implement CBC-MAC with DES?

I should implement a MAC-CBC generation method in C# with some information about the cryptography algorithm. Here's what I have: I should use DES. The key is byte[] {11, 11, 11, 11, 11, 11, 11, 11} The data (16 bytes) should be encrypted in 8-byte…
Kamyar
  • 18,639
  • 9
  • 97
  • 171
2
votes
0 answers

JAVA DES/CBC/PKCS5Padding how encryption translated into iPhone?

source: public static String encrypt(String src, String key) { try { Cipher cipher = Cipher.getInstance("DES/CBC/PKCS5Padding"); DESKeySpec dks = new DESKeySpec(key.substring(0, 8).getBytes()); SecretKeyFactory…
八爪鱼
  • 39
  • 7
2
votes
0 answers

Triple-DES DUKPT CBC PIN variant vs Data variant

Does any know the difference between triple des dukpt decryption algorithm with PIN variant and Data variant? I have done Triple DESK DUKPT PIN variant, which generate session key from KSN and BDK. And then decrypt message using the session key.…
Curly
  • 539
  • 2
  • 7
  • 14
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
vote
1 answer

Equivalent of CBCBlockCipherMac from bouncycastle for swift

I need to re-implement for iOS (swift) a cryptographic operation done for an Android app (kotlin) thanks to bouncycastle's lbrary. The kotlin code is : val mac = "9D3391051A4E774B".hexStringToByteArray() val macKey =…
brice cesarin
  • 105
  • 2
  • 7
1
vote
1 answer

CBC MAC: message length and length prepending

I want to use CBC MAC in C++. First I hope to find some implementation of block cipher which I will use in CBC mode, which I understand is CBC MAC. But I have two questions: 1) If the length of the message to be authenticated is not multiple of…
user5528169
1
vote
1 answer

CBC-MAC implementation in C

I'm hoping to do some benchmarking of CBC-MAC in C. Does anyone know of a robust C implementation? I've looked around but CBC-MAC implementations (in almost any language) seem to be quite rare. Does anyone know why beside its rather restrictive…
John M.
  • 2,642
  • 7
  • 26
  • 55
1
vote
0 answers

Difference between 3DES-DUKPT CBC and 3DES-DUKPT CBC-MAC

Does anyone knows the difference? I am decrypting a chipcard code for one of our vendors EMV machine. The algorithm is called to be 3DES0DUKPT CBC-MAC? I have successfully done 3DES-DUKPT CBC before.... How is CBC-MAC different from CBC during the…
Curly
  • 539
  • 2
  • 7
  • 14
1
vote
0 answers

Use CBC-MAC with CryptoJS

How do I use CryptoJS to generate a CBC-MAC (*not HMAC) block cipher with Triple DES. I can't seem to find it in the documentation.
codemonk
  • 56
  • 1
  • 6
1
vote
1 answer

Sample implementation of java CBCBlockCipherMac in Objective c

Can anyone share a sample code on how to implement CBCBlockCipherMac in objective C. here is how far I got and its giving a different result from the java implementation. const unsigned char key[16] =…
Mayoor
  • 131
  • 1
  • 3
  • 8
0
votes
1 answer

Encryption by matrix multiplication

Working on a college project for simple matrix multiplication based encryption. The project outline is such; text file to matrix multiplied by encryption key matrix= Encrypted file. Encrypted file to matrix multiplied by inverse of key matrix …
midnightBlue
  • 1,735
  • 2
  • 13
  • 13
1
2