Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 655

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

2 votes

Does the HMAC of symmetric key revealed weakens the encryption?

In practice, though, HMAC is safe for that. …
Thomas Pornin's user avatar
1 vote

Why can't a cryptographic hash inside a cryptogram serve as a MAC?

Appending the hash then encrypting the whole lot is not necessarily secure. Actually, depending on the encryption system, it may be awfully weak. For instance, suppose that encryption is done with a s …
Thomas Pornin's user avatar
2 votes

Proper hash_hmac key creation

HMAC uses as key a sequence of arbitrary bytes and of arbitrary length. Some implementations of HMAC/SHA-256 may (unduly) reject keys longer than 32 bytes. …
Thomas Pornin's user avatar
4 votes
Accepted

Reusing HMAC state for multiple messages

Other constructions are possible, such as using the previous HMAC value (you send "m,HMAC(k, z || m)" where z is the HMAC output sent with the previous message). … (The ability of HMAC to operate in an IV-less fashion is the feature which makes it the best generic MAC algorithm. …
Thomas Pornin's user avatar
3 votes
Accepted

How do I build a secure signing mechanism on top of HMAC

Technically, HMAC is a MAC, not a signature. … In particular, the attacker cannot guess the HMAC key, because obtaining the HMAC key would allow him to create a lot of forgeries. …
Thomas Pornin's user avatar
4 votes
Accepted

Determining strength of truncated HMAC

known value+HMAC pairs). … bogus HMAC value (as you do). …
Thomas Pornin's user avatar
3 votes
Accepted

does validating MAC of individual packets validates the integrity of whole file?

The MAC in SSL/TLS is computed over the combination of the record payload and a sequence number, thus ensuring that records are all received, with no missing, out-of-order or duplicated record. The co …
Thomas Pornin's user avatar
4 votes
Accepted

How to guarantee counter synchronisation between client and server for counter in hmac-based...

See HOTP, section E.4. This is reasonably well explained. The gist of the solution: when the counter on the server contains n, the server actually accepts as valid the one-time passwords corresponding …
Thomas Pornin's user avatar
16 votes
Accepted

HOTP with as HMAC hashing algoritme a hash from the SHA-2 family

HMAC/SHA-1 is not broken. … But HMAC resistance does not rely on resistance to collisions. …
Thomas Pornin's user avatar
7 votes
Accepted

Should password hashes be encrypted or HMACed?

Encryption, or a deterministic MAC, may offer you an extra gain of security on the off-chance that the attacker could grab the database of hashed-and-encrypted passwords but not the encryption/MAC key …
Thomas Pornin's user avatar
8 votes
Accepted

Can a salted hash be an effective MAC?

Which is precisely why HMAC was invented: with its double-nested hash invocation, it copes with the non-random-oracleness of MD hash functions. … If you need Performance with a big 'P', the kind which would not be fulfilled by HMAC, then: You have very fast networks, or very slow CPU. …
Thomas Pornin's user avatar
5 votes
Accepted

How do I transfer the HMAC?

Combining MAC and encryption is hard. Depending on how you do it, the result will be secure, or not, or only "mostly secure" modulo a zillion of implementation details. GCM is an Authenticated Encrypt …
Thomas Pornin's user avatar
1 vote

Detect message tampering without shared key and without certificate authority

To detect tampering, you first have to define tampering. You are receiving a message; what would make it a "tampered" message and not the "genuine" message ? The usual definition of tampered/genuine …
Thomas Pornin's user avatar
35 votes
Accepted

Why a symmetric key for HMAC?

When a HMAC value is successfully verified, the Amazon server is convinced that someone knowing the HMAC key was involved; since that key is known only to the client and the server itself, and the server … More complexity: mathematics and code involved in digital signatures are more complex than HMAC (HMAC is just a pair of hash function invocations; digital signatures begin with a hash function invocation …
Thomas Pornin's user avatar
12 votes
Accepted

NIST test vectors for HMAC-SHA-256

Including for HMAC (near the end of that page). In the file contained in the Zip archive, the vectors for HMAC/SHA-256 ought to be the ones with the parameter "L=32". …
Thomas Pornin's user avatar

15 30 50 per page