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.

Filter by
Sorted by
Tagged with
0
votes
1answer
54 views

Design flaws when designing a MAC-function

Suppose we want to build a very basic hash function like this: $$c_i = h(c_{i-1},x_i) = c_{i-1}\oplus x_i \quad\quad mit \;\; i\geq1, c_0 = \operatorname{IV}$$ Now suppose we'd use this hash-function ...
30
votes
1answer
25k views

Ciphertext and tag size and IV transmission with AES in GCM mode

I am completely new to using AES in GCM mode of operation, and I have not a very large background in cryptography as well. I have been playing with OpenSSL trying to encrypt and decrypt some messages. ...
0
votes
0answers
31 views

Why is MAC encrypted in TLS data transmission? [duplicate]

Referring the slide 16 from this link: I want to ask why is MAC encrypted along with the data to be transmitted. Why isn't MAC just appended at the end of encrypted data ?
2
votes
1answer
56 views

ISO 9797 MAC algorithm 3 for 7 bytes

I should implement ISO 9797 MAC algorithm 3 with initial transformation 1, without truncation, and using DES as a block cipher. I should add padding of 0x80, then ...
5
votes
1answer
1k views

Can i modify data “protected” by a CRC16?

There are 100 bytes with a CRC16. However I only know the first 50. I want to change byte 5 from a known value X to another value Y, and fix up the CRC16 to be valid - without knowing bytes 50-100. ...
15
votes
1answer
8k views

GCM vs CTR+HMAC tradeoffs

So these days I see everyone using AES-GCM. What are its advantages over simple CTR+HMAC modes? Is it speed? Or ciphertext length? And what are the security tradeoffs, both in terms of practical ...
0
votes
0answers
34 views

Digital Signature or MAC Yielding Non-Binary Verification Predicate

Is there a digital signature or MAC scheme in which, the verification algorithm returns not $\{\text{Valid},\text{Invalid}\}$, but a discrete (finite or infinite) set of result such as $\{\text{Valid-...
1
vote
2answers
192 views

Why is a MAC verification algorithm required when we can simply create a new MAC and compare the received one with the one calculated?

The process of verifying integrity through MAC involves two separate algorithms (as mentioned here). On the server side, a signing algorithm runs which calculates ...
5
votes
3answers
150 views

What are the benefits of using AEAD algorithms as MAC

I've seen in 2 places where NIST acknowledge the possibility of using AEAD algorithm for MAC (e.g. page 7 section 5.2 of GCM spec, summary for LAEM on page 6 of LWC status report). And I see 2 ...
1
vote
2answers
362 views

Is it fair to say that MACs use a signing algorithm?

The Wikipedia page on MAC calls the algorithm that is used to generate the MAC as a signing algorithm. Is that a fair use of that term? Can we then say that HMAC-SHA-1 uses SHA-1 as the signing ...
182
votes
2answers
88k views

What are the differences between a digital signature, a MAC and a hash?

A message may be accompanied with a digital signature, a MAC or a message hash, as a proof of some kind. Which assurances does each primitive provide to the recipient? What kind of keys are needed?
2
votes
1answer
80 views

Why Authenticated Encryption the same message again is not secure?

It is the Exercise 9.14 (9.1) from the book A graduate course in applied cryptography by Boneh and Shoup. Let $(E, D)$ be an AE-secure cipher. a. $E_1(k,m):=(E(k,m), E(k,m));$ $$D_1(k,(c_1,c_2)):= ...
0
votes
1answer
29 views

Is MAC process different for symmetric and asymmetric?

Message Authentication Code as far as I know works on the shared secret key. Do they work in the same way. Is there no difference between symmetric and asymmetric processes. Can anyone please explain ...
0
votes
0answers
9 views

Extract Certificates from Package File on Mac

I would like to manually verify the certificate chain on a package from my MacOS Catalina. I know that you can use the codesign --extract-certificates to extract certificates from applications, but I ...
1
vote
1answer
72 views

How do the signatures or message authentication codes achieve the authenticity, integrality or non-repudiation?

Actually, I want to know whether there are explicit and formal definitions of the properties which are authenticity, integrality or non-repudiation. It seems that the signatures and MACs can achieve ...
2
votes
0answers
63 views

Is a car odometer reading protected by MAC? [closed]

I knew the reading on a car odometer can be easily modified with the help of some softwares. But isn't there MAC to protect the reading from being modified?
2
votes
1answer
75 views

CBC encryption + CBC MAC reusing key in MAC-then-Encrypt

I'm reading the Handbook of Applied Cryptography by ‎Alfred J. Menezes et al. Especially, I'm stuck with the case that reusing key for CBC encryption and CBC-MAC in MAC-then-encrypt structure. My ...
0
votes
2answers
79 views

If I want Integrity and Authentication AND Non-Repudiation, can the Digital Signature be based on the MAC?

Let's say I'm making a digital signature like this: hash = hash(message) digital signature = encrypt_with_private_key(hash) where the private key is Alice's ...
12
votes
3answers
3k views

What happened to Poly1305AES? Is it obsolete?

I've been told that Poly1305AES is a great choice of MAC for constrained (embedded) environments. I'd checked out DJB's writing on it briefly, and have to say that I found its simplicity likeable, ...
0
votes
1answer
57 views

MAC security game

In the applied cryptography book by Boneh and Shoup, Chapter 6 on MACs, it is stated that one can modify SUF-CMA game by removing verify oracle access to the adversary. Therefore, the two versions are ...
1
vote
2answers
136 views

Concerns about use of MAC in my specification

Here is the pseudocode for a routine I am designing: ...
-1
votes
1answer
32 views

how to predict a sequence for reverse engineering of a ticketing system [closed]

i am student in the fith year of college IT-science and a crypto noob. i have been wondering how the folwing sequence of ticket i bougth in all at once were built for : how they work or how they are ...
21
votes
1answer
15k views

Use cases for CMAC vs. HMAC?

Both can be used to verify the integrity of a message. Assuming you have the needed primitives available to you (i.e. the code space of needing both a cipher and a hash function isn't prohibitive), is ...
5
votes
1answer
1k views

Why is the GHASH output in GCM mode encrypted to calculate the tag?

To calculate the authentication tag in the Galois/Counter mode (GCM), first a MAC is calculated using GHASH over the cipher text and the additional data. After that, this MAC is encrypted using GCTR (...
0
votes
1answer
24 views

Mac-sforge motivation for storing pairs

I don't understand why Q keeping pairs of instead of m like mac-forge solves the problem of generating a new tag on a previously authenticated message. Say, a previously authenticated message for "...
0
votes
1answer
43 views

How can I get VMAC Code in pure c?

I had find a paper about VMAC algorithm:VMAC: Message Authentication Code using Universal Hashing. Now I want to implement this algorithm, But i don't find test vectors about it. Who can give some ...
2
votes
2answers
355 views

Why is $Mac_k(m_1||m_2) = ⟨F_k(m_1), F_k(m_1 \oplus \overline{m_2})⟩$ not a secure MAC?

I am preparing for an exam and trying to solve the following question I found on the internet: Let $F_k$ be a pseudorandom function. Show that the following MAC for messages of length $2n$ is ...
1
vote
0answers
38 views

Implementing MAC with PRF family $f$, why do we need $f_k$ to be invertible?

As per the title, say we have $\text{MAC}(k,m) = (m,f_k(m))$ where $f$ is a PRF family and every function $f_k$ is PRP, where $f_k(m)$ and $f_k^{-1}(m)$ are efficiently computable. I proved that this ...
1
vote
2answers
115 views

Can a MAC be used as a HMAC?

I am reading through an information security book right now, and a confusing question poses itself to me: "Could you use a MAC as a HMAC? That is, does a MAC satisfy the same properties that a ...
2
votes
1answer
40 views

How can an adversary use Mac(.) with a new key to compute a tag although this is not a query to Mac oracle?

I am having some troubles understanding the power of an adversary in attack against a MAC. In chapter 4 in Introduction of Modern Cryptography by Jonathan Katz and Yehuda Lindell, specifically in the ...
1
vote
1answer
153 views

Using AES-GCM (or AEAD ciphers in general) as a pure MAC without encryption

What's the opinion on using an AEAD cipher such as AES-GCM for example as a pure message authentication code (MAC) when only message authentication but not encryption is required. does it bring any ...
369
votes
13answers
127k views

Should we MAC-then-encrypt or encrypt-then-MAC?

Most of the time, when some data must be encrypted, it must also be protected with a MAC, because encryption protects only against passive attackers. There are some nifty encryption modes which ...
8
votes
1answer
1k views

How many codes can I safely generate using the same HMAC key?

Can an attacker guess the key given enough codes for the same key? And if so, how many times is it safe to use the same key?
1
vote
1answer
49 views

Difference between MAC(key, msg) and SHA(key || msg)

I know that SHA(key || msg) is vulnerable to string concatenation attack. However, what if we specified key bit-length and msg bit-length? For example, key bit-length is 256 bit and msg bit-length is ...
1
vote
1answer
56 views

Using Poly1305 MAC key multiple times

I know that for Poly1305-ChaCha20 reusing the key does reveal information about the plaintext. How it is for the Poly1305 MAC algorithm? Revealing information about the plaintext is not a problem at ...
0
votes
1answer
794 views

CMAC Generation : If input payload length is not aligned in 16 bytes, what are the possible side effects?

While searching for answers ,I understand that RFC AES-CMAC 4493 is suggested by NIST to overcome if payload is not aligned in 16 bytes. I would like to know what drawbacks/insecure caused by AES-...
1
vote
1answer
93 views

Replay attack resistant MAC?

I came up with a threat model where: Alice and Bob agree on a shared key $K$ Alice sends a plain text $M$ and its $\operatorname{MAC}$ tag, $T = \operatorname{MAC}(K,M)$ to Bob over an untrusted ...
3
votes
1answer
102 views

Insecure MAC built on pseudorandom function

this is a question about Katz-Lindell book, introduction to modern cryptography, 2nd edition, exercise 4.7, part c. For (a) and (b) it is clear that the Macs are insecure, but for (c) I am struggling ...
0
votes
0answers
38 views

How to forge a signature in a custom PMAC implementation

From a crypto challenge i have the following PMAC variant where the task is to forge a signature to fulfil a specific condition: Preparation: in the finite Field GF(2^128) with the polynomial x^128 + ...
2
votes
1answer
68 views

Can poly1305 be used as an error-correction code?

Given a message $m$ of size $n$, a key $k$, and a message authentication code $mac = poly1305(m, k)$ what is the minimum amount of bitflips on the message that can be corrected (or at least detected) ...
-3
votes
1answer
120 views
2
votes
0answers
37 views

Attackability of one-time MAC when using block mode

Consider an encrypted message m which is encrypted with AES-CBC, so in addition to the message there is an IV supplied initially....
0
votes
0answers
42 views

XORing Algorithm Outputs To Guard Against Breakthroughs

My question is how safe is XORing two algorithm outputs together... ...For Symmetric Encryption: Master key from CSPRNG ==> MK HKDF-Expand(...
2
votes
1answer
5k views

How is HMAC hashed message decrypted on the receiver side

We know that MAC algorithm and key are used in both sender and receiver side to get the matching MAC tages to prove that the data is authentic. Now in HMAC we know that, it makes use of crytographic ...
1
vote
1answer
146 views

Using Permutation polynomial to compute a MAC

Is the following MAC secure? For a block $y_i$ in a file, we defined a MAC as follows: $Mac_i:PRF(k,i) \cdot g^{y_i \cdot r_i} \bmod p$. Where $p$ is a prime number, $g \in \mathbb{G}$,$PRF(k,i)$ is ...
1
vote
1answer
220 views

Composition of X25519+XSalsa20+Poly1305

In an correct implementation of X25519+XSalsa20+Poly1305, I think I have the right understanding in saying that the Poly1305 message authentication code is a ...
1
vote
1answer
58 views

Attack on envelop mac

As I am reading the Paper: MDx-MAC and building fast MACs from hash functions I am having trouble understanding the Attack on the Envelope Method (4.3). In particular, I am not sure what chaining ...
1
vote
0answers
47 views

Circular Security - Encrypting the key with the key

I know this isn't the best practice, but what if I took a cheap/fast 128-bit stream cipher (assuming both the key and the stream blocks are 128 bits) and mixed in the plainkey with the plaintext (let'...
2
votes
1answer
75 views

Can we get the msg when we know tag and key in Poly1305

Assume $tag[i]=\operatorname{MAC}(key[i],msg)$ Now we know: $tag[0],tag[1],\ldots,tag[n]$ $key[0],key[1],\ldots,key[n]$ Can we get the $msg$ from this? Or can we get the $tag$ of this $msg$ using ...
35
votes
4answers
7k views

Why is plain-hash-then-encrypt not a secure MAC?

It seems that even in MAC-then-encrypt systems like SSL, something like HMAC is used rather than a plain hash. Why? Suppose we use some stream cipher; then why can't we use $Encrypt(m | H(m))$ as ...

1
2 3 4 5
10