Questions tagged [hmac]

HMAC is a method for constructing a message authentication code based on a cryptographic hash function.

Filter by
Sorted by
Tagged with
6 votes
1 answer
737 views

HKDF randomness extraction - salt or no salt?

According to the HKDF paper, the use of a salt serves two purposes: domain separation and randomness extraction. This question is solely about the necessity of a salt for the purposes of randomness ...
knaccc's user avatar
  • 4,712
4 votes
1 answer
575 views

Applications in which you should/shouldn't use a salt with HKDF

rfc5869 has the following to say about the use or lack thereof of salts with HKDF: HKDF is defined to operate with and without random salt. This is done to accommodate applications where a salt value ...
nohatsatthetable's user avatar
2 votes
2 answers
1k views

Why bother to generate Key, IV and encrypt them?

When we perform encryption with Public or Private Key, Asymmetric AES with RSA and CBC 128, and when we use the padding as well. Why do we have to bother adding the additional: Key + IV? ...
user avatar
1 vote
3 answers
233 views

Zero-knowledge proof of HMAC digest

I'm reading the Wikipedia for HMAC, and I feel a little bit lost. I'm wondering if there exists... $$digest = \operatorname{HMAC}(msg, key)$$ Is it possible to prove that $digest$ is computed from $...
user avatar
1 vote
0 answers
522 views

Why does HMAC use the hash twice? [duplicate]

According to the HMAC specification in RFC2104, an HMAC is computed in the following way: HMAC(K, text) = H(K XOR opad, H(K XOR ipad, text)) where ...
Fabian Schmitthenner's user avatar
2 votes
1 answer
123 views

Should I use HMAC to create a multiple part HASH token

I have a web API with a custom API authentication system that users each have a SecretKey and a public ApiKey. Using these two keys client(or user) can generate a token for the authentication on the ...
AliReza Sabouri's user avatar
2 votes
0 answers
62 views

key reuse: does knowing H(S) reveal HMAC(S)

given a hash H() , like sha256 and a secret text S and a public salt P will knowing H(S) reveal HMAC(P, S) ? to clarify: the question is if it possible to learn the digest, not the secret. In my ...
aep's user avatar
  • 121
0 votes
1 answer
212 views

Reverse SHA256 Hashed Value from Multiple Instances where Part of Hashed Value is known

I apologize in advance if this question has been answered already. However, I have not been able to find an existing answer - despite the case being pretty simple and common I imagine. Perhaps there ...
Thomas Sylvest's user avatar
1 vote
2 answers
286 views

Why is birthday attack invalid on this MAC

I am trying to understand why the following birthday attack is invalid for this MAC construction. Let Mac : $\{0, 1\}^{128} \times \{0, 1\}^{256} \to \{0, 1\}^{128}$ be a MAC. Consider the following ...
user avatar
0 votes
0 answers
16 views

Use HMAC for every block encryption operation [duplicate]

Is it possible to use HMAC while performing encryption of blocks? I think that the main problem with the approach would be to get the same output size as the block, from the HMAC function. Also, the ...
Ronnie1023's user avatar
0 votes
1 answer
81 views

Can a one time public key'd HMAC be secure?

Imagine authentication like $hmac = H(nonce, ciphertext)$. $nonce$ is truly random and chosen (randomly and WITHOUT replacement) from predetermined set $N$. So ${nonce} \in N$ and once used cannot be ...
Paul Uszak's user avatar
  • 15.1k
0 votes
0 answers
42 views

What is the difference between HMAC-SHA3-512 and KMAC? [duplicate]

Reading through the wikipedia entry for HMAC I see that SHA-3 can be used with the HMAC algorithm to give HMAC-SHA3-512. I also know that there is KMAC, which from ...
dade's user avatar
  • 133
0 votes
1 answer
234 views

How to produce Auth Data and tag in GCM? Does MAC appended CTR mode encrypted text weaker than GCM?

In https://en.wikipedia.org/wiki/Galois/Counter_Mode, there's a diagram which tells us how GCM works in general. I have watched computerphile video on how ECB,CBC and CTR mode works and able to ...
Hern's user avatar
  • 125
2 votes
2 answers
435 views

Is there any good attack model of HMAC?

Are there any good attack models of HMAC? Like how it can be attacked? If there are any possible attacks of HMAC I would be happy to know about it.
malik bilal's user avatar
0 votes
0 answers
402 views

What is the need of xor-ing the key with an outer and inner pad in HMAC?

The diagram above shows the standard HMAC algorithm. However consider the algorithm of HMAC without xoring the key with outer or inner pad. In other words let the structure of HMAC remain the same ...
Abhisek Dash's user avatar
1 vote
1 answer
255 views

Is the collision chance 2^(n/2) of an n-bit tag τ unchanged if reduced to (n/2)-bits using a reduction of τ to some 2^(n/2) order group element?

If $H(k, Μ) = τ$, in the context where $τ$ is an $n$-bit tag produced as a mac on a key, $k$, and a message, $M$, through a keyed-hash function, $H$, is there a function $F(τ) = T$ that transforms $τ$ ...
aiootp's user avatar
  • 785
5 votes
1 answer
468 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 ...
ManRow's user avatar
  • 323
1 vote
1 answer
325 views

HMAC key generation and encoding

I've this piece of .NET code that is based on a Microsoft sample on how to generate a key and sign using HMACSH256. But I've altered the key generation a little bit and also decided to use Base64 to ...
danutz_plusplus's user avatar
0 votes
1 answer
684 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:...
adi's user avatar
  • 175
0 votes
1 answer
62 views

Necessity of PBKDF2 in current Setup?

I have a single password which is random bytes that encrypts a database. Right now I am using an encryption scheme of https://gist.github.com/jbtule/4336842. To summarize, we take our one password, ...
Sidney Deane's user avatar
3 votes
1 answer
73 views

Can future time-based keys be deduced from a previous key?

If a time-based key generated by an authenticator app like Google Authenticator is compromised, can future keys be deduced from the compromised key?
Oscar's user avatar
  • 33
0 votes
1 answer
818 views

Does SHA384 make sense with HMAC-SHA256?

In the sense of security level (as defined, for example, by Ferguson and Schneier in the book Practical Cryptography), does it make sense to use SHA384 with HMAC-SHA256 in the general settings. By ...
Curious's user avatar
  • 115
0 votes
1 answer
291 views

Use peppers with Bcrypt (HMAC + Bcrypt)

Is it useful to combine HMAC with Bcrypt ? If it so, should I do the HMAC on the password before "Bcrypt"ing it ? or should I do the HMAC on the Bcrypt output ?
Mohammed Rady's user avatar
0 votes
0 answers
125 views

Managing master keys used in PBKDF2 and HMAC (store, rotate)

My use case: I have few master keys, I use each for a specific operation (e.g. one for encrypting user's data and another for creating JWT signatures etc...). I use these master keys in two specific ...
Mohammed Rady's user avatar
2 votes
2 answers
266 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 ...
automatictester's user avatar
0 votes
1 answer
64 views

Complexity of deriving message from CMAC vs HMAC when the key is known

From the description of CMAC and HMAC, given the key and the tag, I think it is easy to derive the CMAC message than the HMAC message. After obtaining the key and tag for CMAC, an intruder can apply ...
Mohit Kumar Jangid's user avatar
2 votes
2 answers
154 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 ...
leftfold's user avatar
2 votes
0 answers
53 views

Confused about encapsulation using different types of hash functions

I'm reading Improved Efficiency for CCA-Secure Cryptosystems Built Using Identity-Based Encryption. In Section 4 there is a description of encapsulation schemes that says We suggest an encapsulation ...
fraiser's user avatar
  • 438
0 votes
0 answers
79 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 ...
Guest's user avatar
  • 1
2 votes
1 answer
494 views

What does the running transcript hash in RFC-8446: TLS 1.3 do?

From RFC8446: In general, implementations can implement the transcript by keeping a running transcript hash value based on the negotiated hash. Note, however, that subsequent post-handshake ...
engine32's user avatar
2 votes
1 answer
122 views

Question about IETF RFC6979 determinisitc (EC)DSA document section 3.6 additional data k'

In RFC6979, on page 14, Section 3.6 "Variants": o. Additional data may be added to the input of HMAC, concatenated after bits2octets(H(m)): ...
anmin's user avatar
  • 41
1 vote
0 answers
125 views

What's the difference between H(m) $\oplus$ H(key) and H(m || key) in MAC construction?

We all know that HMAC has the form of $H(ikey || H(okey || M))$. I'm wondering what if we replace the H(okey || M) into H(okey) $\oplus$ H(M)? In other words, is $$H\Big( ikey \mathbin\| \big( H(okey) ...
Max1z's user avatar
  • 145
0 votes
1 answer
583 views

How to calculate a hmac and cmac

I'm searching for a simple description that tells me in a schematic way how hmac and cmac is calculated. So far I found the following: ...
MaMa's user avatar
  • 39
1 vote
2 answers
188 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 ...
augustus's user avatar
3 votes
1 answer
355 views

Encrypt-then-HMAC with a single key is secure?

The partition oracle attacks exploits the non-committing AEAD schemes. Informally, a committing encryption scheme is one for which it is computationally intractable to find a pair of keys and a ...
kelalaka's user avatar
  • 47.5k
0 votes
0 answers
955 views

Bitcoin Key Recovery Without Nonce Re-Use

There are a lot of questions in these forums regarding the recovery of private keys. But I'm here to postulate on something unique to a specific piece of research that I looked into recently. The ...
librehash's user avatar
  • 135
2 votes
1 answer
952 views

Generating HMAC(SHA256) keys using WebCrypto deriveKey() API

I am using the javascript WebCrypto API window.crypto.subtle.deriveKey() API to generate HMAC keys like this: ...
cristian's user avatar
1 vote
0 answers
23 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 ...
Evan Su's user avatar
  • 421
0 votes
1 answer
112 views

How do high hash rates affect hashed password security?

Given the increase in hash rate since the rise of numerous block chains, I wonder how this affects the security of many hashed password systems. Is a standard linux ...
rob's user avatar
  • 31
1 vote
1 answer
109 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 ...
guest's user avatar
  • 11
0 votes
0 answers
29 views

Randomizing output of HKDF for the same input key material [duplicate]

Given HKDF and a master input material key $k$, I would like to derive ephemeral keys that cannot be linked together. If I understand correctly, the specification of $HKDF$ adding a unique random $...
Ziva's user avatar
  • 235
1 vote
1 answer
329 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-...
guest's user avatar
  • 11
1 vote
0 answers
207 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:...
Sayantan's user avatar
6 votes
1 answer
2k views

Is HMAC-SHA256 a PRF?

In the abstract of The Exact PRF-Security of NMAC and HMAC, Gazi, Pietrzak, and Rybar state: NMAC was introduced by Bellare, Canetti and Krawczyk [Crypto’96], who proved it to be a secure ...
joshlf's user avatar
  • 245
5 votes
1 answer
478 views

Is the HMAC of a broken hash such as MD2, MD5, SHA1 etc, also broken?

As we know, MD5 and SHA1 (to some extent) are broken, and older algorithms like SHA0 or MD4 and MD2 are very broken. Does this also imply that the corresponding HMACs are also broken? Obviously nobody ...
RocketNuts's user avatar
  • 1,397
0 votes
0 answers
414 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 ...
Evan Su's user avatar
  • 421
2 votes
2 answers
396 views

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

Would this encryption and signing scenario be considered tamper-proof? ...
Evan Su's user avatar
  • 421
1 vote
0 answers
151 views

Schnorr Protocol Implementation - Sometimes Fails on Curve25519

I am implementing the Schnorr Protocol in python and am having reliability issues when using some curves. I am wondering if this is an issue with my logic, or some implementation issue. I am using ...
Goodies's user avatar
  • 145
2 votes
1 answer
287 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 (<...
Zixradoom's user avatar
  • 123
-1 votes
1 answer
63 views

Encryption on one AES mode and decrypting on another, where both use HMAC

Let's say there are 2 ciphers, $enc$ and $dec$, where: $enc$ will encrypt the data, and $dec$ will decrypt it. Both $enc$ and $dec$ must be an AES cipher. $enc$ and $dec$ will use the same key $k$ ...
arunanshub's user avatar

1
2
3 4 5
13