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
4
votes
1answer
190 views

Is $H(k || m) \oplus k$ secure?

It is known that $H(k || m)$ (when using SHA1) is an insecure MAC function since it is vulnerable to hash length extension. But what about $H(k || m) \oplus k$? A normal hash length extension seems to ...
0
votes
1answer
40 views

Why are des-cbc-hmac and rc4-hmac-exp considered weak in kerberos?

Kerberos uses des-cbc-hmac (mac and encrypt) and rc4-hmac-exp based on md5 (mac and encrypt I think) in their encryptions. Those encryptions are considered as weak and should not be used. Why are they ...
0
votes
0answers
26 views

MAC Security - MAC verification queries

In the applied cryptography book by Boneh and Shoup, Chapter 6 on MACs, it is stated that an adversary that is also capable of requesting the challenger for verification queries (in addition to ...
4
votes
1answer
292 views

Does hashing an ECB encryption with a strong hash function produce a secure MAC?

Does applying a strong hash function like SHA-256 to the ECB-encryption of a message (using some secret key $K$) produce a secure mac? For example, given a message $m$, would a simple mac construction ...
0
votes
1answer
58 views

What authenticated encryption do kerberos use in windows?

I have learned about the kerberos protocol and seen that the windows version uses a couple of authenticated encryption schemas (like rc4-hmac-md5). What type of authenticated encryption is it? Is it a:...
0
votes
0answers
18 views

layout scheme to store encrypted files

I'm working on a little hobby project to better understand crypto. https://app.gitbook.com/@noojee/s/dvault/ The aim is to make it easy to encrypt a set of files into a 'vault' and decrypt them at a ...
2
votes
1answer
61 views

What benefit is gained when combining AES GCM/GMAC with ECDSA?

This is a real world question (and as I'm not an expert in cryptography I have only some basic knowledge in terms of just using it, not a deep understanding how ist works under the hood.): A system ...
0
votes
1answer
58 views

AWS signature v4 key derivation

Generating Authorization header with AWS signature v4 involves deriving signing key as follows: https://docs.aws.amazon.com/general/latest/gr/signature-v4-examples.html ...
0
votes
1answer
62 views

How to compose multiple values to MAC authenticate?

If the data I want to authenticate consists of multiple values and I compute a MAC simply concatenating the values, an adversary can "shift" characters within those values without ...
2
votes
0answers
90 views

Is the following derived MAC where the output is XOR'ed with the key secure?

Hey I'm wondering if the following scheme is secure or not , I tried reductions and some tries to prove that it not must be secure but I feel completely stuck . More details: It's just any reduction ...
0
votes
0answers
43 views

Algorithm to validate 1 of N inputs is part of output hash

Is there an algorithm that allows proofing that an input x1 was used as 1 out of N inputs to create an output hash y, without ...
1
vote
0answers
52 views

TLS 1.3 Handshake - Usage of MAC and Digital Signature for CertificateVerify and Finished Message

I was wondering, why the TLS 1.3 handshake employs two different 'messages' that compute an authentication code over the whole handshake. As far as I understand, the CertificateVerify "message&...
2
votes
1answer
47 views

Is it possible to do partial message authentication?

I want to authenticate part of a message, not all of it, while creating the MAC over the entire message. Let's say I create a 16B MAC over one hundred message blocks that are 64B each. Then I send one ...
1
vote
2answers
55 views

Why is xor'ing plaintext blocks and encrypting the resulting checksum not a secure MAC using CTR mode? [closed]

Consider message $P$ being split into $n$ blocks that match the block size of the underlying block cipher. The message has fixed length and the length is always a multiple of the block size. ...
0
votes
0answers
42 views

Is 64-bit SHA-256 IV-based MAC for fixed-length messages reasonably secure?

I want to use truncate8(SHA256-nopad(IV=secret, message)) as a 64-bit MAC, where message is guaranteed to be exactly one hash ...
2
votes
1answer
74 views

Is the padding wrong on the "Length Extension Attack" Wikipedia page example?

In the Length extension attack of Wikipedia The following information summarizes the relevant information provided on the page at the time of posting this question. The provided parameters are secret ...
15
votes
5answers
2k views

AES GCM : is it acceptable to return the wrong plaintext if the tag is incorrect?

Let's start by saying I'm no cryptography expert, I'm just a developer, so feel free to correct me (using words, not downvotes) if what I'm saying is non-sense. Context: I'm doing some crypto as a ...
0
votes
1answer
60 views

Is the tag in a MAC scheme a fixed size?

I've been reading up on MAC schemes. But I cannot seem to find out whether the tag's that are output by running MAC(m) is of a fixed size? I can find a lot of stuff talking about the tag space being a ...
1
vote
1answer
92 views

Constructing a mac scheme secure to regular definition but insecure to special case

The mac-forge security game for mac schemes looks like this: $k \leftarrow \operatorname{Gen}(1^n)$; $(m,t) \leftarrow A^{\operatorname{MAC}_k(⋅)}(1^n)$; Let $Q$ denote the set of all queries that $A$...
0
votes
1answer
78 views

IND-CCA insecurity of modified CBC encrypt + MAC scheme

I've been puzzling over the following proof for the past couple of days. Since a block cipher in CBC mode can be used to build both an IND-CPA secure encryption scheme and a EUF-CMA secure block, a ...
0
votes
0answers
19 views

Why does AES_GCM sometimes has a SHA for integrity? [duplicate]

For example the following suite: TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 From what I understand the SHA384 at the end is used to authenticate the message, which is exactly what MAC does, and the mode ...
0
votes
0answers
21 views

Why doesn't appending a message to a key instead of vice versa defeat length extension attack? [duplicate]

It's well established that H(K||M) is vulnerable to length extension attacks for SHA-2 and other hashing algorithms, and instead an HMAC construction should be used. However - why can't H(M||K) be ...
1
vote
2answers
75 views

Is nonce-less Encrypt-then-HMAC as secure as poly1305

While reading https://crypto.stackexchange.com/a/88732/87450 I noticed that it suggests encrypt-then-HMAC as a defense for partition attacks. However as far as I know unlike poly1305, HMAC does not ...
1
vote
1answer
146 views

Hash and (MAC) based signatures using zk-SNARK

I was wondering if we could use any general symmetric key MAC, a collision resistant hash $H$ and zk-SNARK (or any general NIZK scheme) to construct a signature scheme. I have a MAC key $k$, which is ...
1
vote
0answers
21 views

Is Poly1305 enough for cascading ciphers? [duplicate]

ChaCha20 along with Poly1305 provides confidentiality and integrity. Now suppose I cascade AES on top of ChaCha20. Is it safe to assume that the Poly1305 MAC is still secure, even if I cascade ...
0
votes
0answers
43 views

Authentication tag length and post-quantum security

The recommended hash length for post-quantum security seems to be either 384-bits or 512-bits. 512-bits gives 256-bit collision resistance, and 256-bit security is obviously ideal for post-quantum ...
1
vote
1answer
127 views

HKDF Bit Security

I've always understood the bit security of hash functions to be related to their output size (eg. collision resistance). However, I recently came across a table from a Wickr blog post that lists HKDF-...
1
vote
0answers
73 views

Forgery of the Carter-Wegman MAC

Consider the nonce-based Carter-Wegman MAC which works on key space $K=\{0,1\}^n \times \{0,1\}^n,$ message space $M=\{0,1\}^{mn}$, nonce space $N=\{0,1\}^n$ and the tag space $T=\{0,1\}^n$ as follows:...
0
votes
0answers
59 views

Insecure pseudo random functions

Let $F$ be a pseudo-random function. Show that the following constructions are insecure as message authentication codes (in each case $K \in \{0,1\}^n$ is the private key): $(a)$ To authenticate a ...
2
votes
1answer
45 views

Corelating between the concept of Universal Hashing wrt Algorithms (hash-table use) & the use of Universal Hashing in a one-time MAC

Trying to understand the concept of a Universal Hashing function. From Introduction of Algorithms by Cormen, Rivest et al We now define the hash function $h_ab$ for any $a \in Z^*_p$ and any $b \in ...
0
votes
1answer
70 views

Attacks on the RawCBC-MAC if the final step of encrypting with a second key isn't done

This is from Boneh's lecture ECBC-MAC Here is also a link to the lecture itself - https://www.coursera.org/learn/crypto/lecture/QYT6i/cbc-mac-and-nmac CBC-MAC with $(K_1, K_2)$ on a message $M$ ...
0
votes
0answers
55 views

How secure is Encrypt-And-MAC?

From this popular Crypto.SE thread, the general feeling is that Encrypt-Then-MAC is the most secure. From the first answer, the poster says that Encrypt-And-MAC provides integrity of the plaintext. If ...
2
votes
2answers
300 views

Is E_k(M)||H(m) form of MAC secure?

Would this encryption and signing scenario be considered tamper-proof? ...
2
votes
1answer
116 views

AES-128/CTR/NoPadding HMAC vs Signature

Is there a semantic difference between tagging AES_128/CTR/NoPadding ciphertext with a MAC (HmacSHA256) or Digital Signature (<...
2
votes
1answer
188 views

What is the overhead of GCM? And how are GCM tags signed by RSA/PKI?

I'm mainly trying to wrap my head around the pipeline of encryption, hashing and signing. I've read over this question, describing the overhead of GCM, which I understand to be configurable for space-...
2
votes
0answers
107 views

What is the original paper of the length extension attack on hash based MAC functions

A message authentication code (MAC) based on using a hash function with the secret prefix $H(k||m)$ technique goes back to two independent sources according to Tsudik's article on 1992; S. Crocker, S....
4
votes
2answers
209 views

MAC-then-encrypt in SIGMA protocol for authenticated key exchange

The SIGMA protocol proposed in 2003 and used in TLS 1.3 and IKE stands for "SIGn-and-MAc" and can optionally protect identity using encryption. The SIGMA-I variant illustrated below ...
3
votes
1answer
179 views

CMAC - how is ambiguity resolved?

To avoid the dummy padding block, CMAC uses 2 separate keys K1 & K2. If padding is required, the final block is padded & then XORed with K1. If no padding is required, then it's XORed with K2. ...
2
votes
1answer
142 views

Can a CCA-secure cryptosystem be used as a CMA-secure MAC?

Can every CCA-secure cryptosystem be used as a CMA-secure MAC? I know that every CCA-secure system is CPA-secure, but I'm not sure about CMA. From what I understand: for a system to be CCA-secure, it ...
0
votes
0answers
58 views

Constructing a no-query secure MAC II

I'm trying to construct a no-query-secure MAC $II=(Gen,Mac,Vrfy)$ without using any cryptographic primitives such as PRF, PRG, has function, etc. My-attempt: I learned that a message authentication ...
0
votes
0answers
40 views

Using AES to create a secured MAC

Considering public message M and private key K, would it be safe to create the MAC tag this way: $$MAC(M,K) = AES(m_1) \oplus AES(m_2) \oplus \cdots \oplus AES(m_n)$$ when $m_1,m_2,\ldots,m_n$ are n ...
1
vote
1answer
96 views

byte significance with hash functions

I am using the python hmac module to generate an authentication code. Given a key, message, and hash function (I am using md5), the library returns an authentication code as a python bytes object. I ...
1
vote
1answer
115 views

Are MAC algorithms and digital signatures secure from quantum computers? If not, why?

I understand that asymmetric encryption is fundamentally deemed useless under Shor's Algorithm, and understand that symmetric encryption is somewhat quantum-resistant as long as the key-length is ...
2
votes
1answer
112 views

Encrypting data with HMAC-SHA1 challenge response as the key

I came across a piece of software that uses the following algorithm to generate a symmetric encryption key to encrypt data. Generate a non-secret 64 byte random string $M$ (fixed challenge) Generate ...
0
votes
0answers
37 views

Do i need MAC if i sign the message with for example ed25519? [duplicate]

If I understand correctly MAC makes sure that the encrypted message isn't altered, so I presume signing the message with for example ed25519 would do the job too. Am I right?
1
vote
1answer
61 views

Given a collision in a MAC function, is it possible to work out how the MAC function works and generate valid MAC values for any message?

So given you can find a collision for any MAC value, would this be viable without knowing the key. Even if you couldn't figure out how that MAC function works, could you find valid MAC values for a ...
2
votes
1answer
62 views

MAC forgery using the DES's Complementary Property

I've started reading on MACs and working on a problem where given a MAC construction as $H_0=IV$ and for every $i>0$ $H_i=H_{i−1} \oplus E_{M[i]}(H_{i−1})$ and the tag is $(IV,E_{k_1}(H_ℓ))$, I ...
1
vote
0answers
54 views

CBC-MAC variable-length weakness with MAC size greater than the encryption block size

The title mostly explains it; CBC-MAC variable-length weakness with MAC size greater than the encryption block size I've seen that by having the pairs $(M,T_m)$ and $(N,T_n)$, we can generate a ...
0
votes
0answers
38 views

Compare two protocols of keyed hash functions

Authentication protocol using a keyed hash function: Alice and Bob share a secret key for a keyed hash function. The protocol is: Alice $\Rightarrow$ $m||h_{k}(m)$ $\Rightarrow$ Bob. There are the ...
0
votes
0answers
139 views

How to forge a CBC-MAC

I'm looking for a very clear explanation of how to forge a CBC-MAC. Given M1 = m1 and M2 = m1||m2 and M3 = m1|| m2 || m3$ and their respective MACs are MAC1 MAC2 and MAC3. How would I go about forging ...

1
2 3 4 5
11