New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs

# Questions tagged [mac]

(or message authentication code), a short piece of information used to authenticate a message, and the algorithm to create and check such information, using a secret key.

586 questions
Filter by
Sorted by
Tagged with
21 views

### Shared taxonomy for hash, mac and digital signature algorithms and output?

I'm creating a cryptography API, and because naming things is hard, I'm trying to define a common name that identifies functions that accept input of arbitrary length and produce either digital ...
75 views

### Linear Message Authentication Codes

I am studying the message authentication codes introduced in this paper. These MACs are linear in the sense that, if $f(m,k)$ denotes the tag appended to the message $m$ when the agreed upon key is $k$...
• 123
100 views

### Understanding CBC-MAC Algorithm and Nested Encryption

In the CBC-MAC algorithm as given in the image below, I have two questions: It is said that the CBC-MAC is simply the last block of ciphertext if the message is encrypted using CBC block cipher mode, ...
• 75
134 views

### How do I generate a sequence of numbers with unpredictable differences

This question relates to bit flip attacks on OTP encrypted messages. Lets say I've got a list of numbers from 0 to 2^24-1 I want to re-order the list so it has the following property: If you start at ...
• 141
20 views

### Reduction For MAC systems

I am not too knowledgeable regarding reductions for message authentication code encryption. Here is an example I found: There is a MAC' based on a preliminary existing MAC as such: MAC'(k, m) = MAC(k,...
• 21
1 vote
93 views

• 31
46 views

### Parallelizable MAC/hash value stored securely

Assume the following: $E: \{0, 1\}^k \times \{0, 1\}^b \rightarrow \{0, 1\}^b$ is a block cipher with a $k$-bit key size and a $b$-bit block size. $T$ is a $b$-bit authentication tag that is ...
• 3,655
989 views

### HMAC SHA256 walkthrough examples

I'm trying to implement HMAC SHA256 (I've implemented SHA256 successfully). I am trying to find examples where they show the results after each HMAC stage (XOR, append, H etc). Does anyone know of any ...
• 123
214 views

### Does HMAC provide anything that AES GCM does not?

I would like to let the receiver has the ability to check the sender's authenticity when he gets the message. Also, I want to protect the message's confidentiality and integrity. Should I use ...
1 vote
71 views

### Is it undesirable for authentication to require decrypting a ciphertext?

A couple years ago, I devised some primitives for block ciphers and block cipher modes of operation; I was partly inspired by CAESAR. What these designs all had in common is that the encryption/...
• 3,655
140 views

### Verify HMAC tag without knowing the key

Let's say there's Alice and Bob. Let Alice and Bob agree on a message $M_1$, a tag $T_1$, and a function $HMAC$. Alice proves to Bob that she knows a key $K$ such that $T_1 = HMAC(M_1, K)$ without ...
• 345
819 views

### Does the order of validations and MAC with clear text matter?

I have a request in which I get a series of data in clear (nothing encrypted) and a MAC / authentication tag. The question is whether the MAC should be validated first or if the fields are filled in ...
118 views

### Does having more than one HMAC provide more information to the attacker?

Suppose $N$ many messages has been sent from $A$ to $B$ in this format: $\operatorname{HMAC}(K, C(i)) \mathbin\| C(i)$. Where $C(i)$ is some cipher-text encrypted with some secure algorithm using ...
81 views

### Is my domain separation in stream cipher and MAC accepted?

I would like to implement domain separation in encryption/decryption along with MAC. The encryption algorithms consists of XChaCha20,XSalsa20,SM4 From China and MAC algorithms consist of HMAC-SHA512 ...
• 159
120 views

### Paper based OTP and MAC

Consider the following paper based OTP Plaintext has 11 possible symbols 0-10. $C_i = M_i + K_i\ mod\ 11$. $K_i$ comes from a pre-shared key material which is never reused. How to introduce data ...
• 2,449
1 vote
184 views

### Quantum-Safe MAC: HMAC and CMAC

If understood right, CMAC is not quantum-safe because it relies on AES-128 (which isn't considered as quantum-safe), while HMAC is, because it relies on SHA3 (which is considered as quantum-safe). Did ...
• 163
259 views

### Security of using key size larger than the message digest size in HMAC, with one time pads

I would like to know the security of using key size that is larger than the message digest (output) of a HMAC in one time pad encryption. One time pads for the message and the key of HMAC are ...
1 vote
70 views

• 11
1k views

### CBC-MAC Forge Attack Question

I am trying to understand how the forgery attack works when using the CBC-MAC Algorithm
• 161
1 vote
82 views

### Symmetric MAC benefit

I have a question about symmetric message authentication codes (MACs). Say Bob sends encrypted messages to Alice using a symmetric cipher. As I understand it: (1) Their threat model could or should ...
707 views

### Is constant-time compare really required for AEAD ciphers?

When verifying a (HMAC) authentication tag it is often indicated that a constant-time comparison is required for security. I can see how leaking information about a password hash can introduce a mild ...
• 93k
1 vote
215 views

### How to know that MAC isn't modified in ECIES

I am new to ECC but I was wondering, If there is a situation where instead of the ciphertext being falsified, the sent MAC was tampered. How does the receiver verify that the ciphertext is still ...
131 views

### Hash Function Vs Signature Vs MAC?

I read: What are the differences between a digital signature, a MAC and a hash? and Found this amazing answer: https://crypto.stackexchange.com/a/5647 But one question remains: I know that for huge ...