Questions tagged [hmac]
HMAC is a method for constructing a message authentication code based on a cryptographic hash function.
620
questions
3
votes
1
answer
186
views
Is the mod_auth_tkt scheme secure?
The third-party Apache plugin mod_auth_tkt uses a tragically-not-HMAC construction:
...
16
votes
2
answers
2k
views
Why is the salt used only once in PBKDF2, while the password is used often?
The purpose of PBKDF2 is to create a derived key (DK) from a master password (PW) and a salt, often using a function like HMAC-SHA256. I have read that the salt should be as random as possible. But ...
3
votes
1
answer
460
views
What are the safe ways to derive HMAC key using block cipher?
Suppose we have a state of block cipher initialized with some key unknown to us, that is, we have the state after running key schedule, but we have no access to actual key or subkeys, all we can do is ...
41
votes
4
answers
5k
views
Purpose of outer key in HMAC
From what I know, the HMAC constructions has two strength:
It's resistant to length extensions
Since the key is consumed before the message, the attacker does not know the initial state, preventing ...
7
votes
3
answers
4k
views
Which of these 3 AES 128 symmetric encrypt/decrypt routines is most secure?
I am developing a symmetric en-/decryption routine written in c# for a database containing user-specific, sensitive information.
I have narrowed down the implementation to 3 different approaches, ...
46
votes
2
answers
14k
views
What do the magic numbers 0x5c and 0x36 in the opad/ipad calc in HMAC do?
Wikipedia lists the following pseudocode for HMAC:
...
28
votes
2
answers
25k
views
HMAC vs MAC functions
I've read definitions of MAC and HMAC, but can't say I've completely grasped the differences.
What are principle differences?
When to use one and when the other?(Typical Use Cases)
5
votes
2
answers
437
views
Is this streamable combination of encryption and MAC secure?
I want to combine encryption and MAC.
For encryption I use AES-256 with CBC and PKCS5Padding.
For MAC I use HmacSHA512.
I use the Encrypt-then-Mac approach (calculate MAC over the ciphertext and ...
11
votes
1
answer
675
views
Which MACs can be converted into a secure unkeyed hash function?
It is known that setting the secret key to a fixed, public value does not make MACs like CBC-MAC or GMAC into secure unkeyed cryptographic hash functions that could be used - for instance - for ...
7
votes
1
answer
712
views
Memory-hard operations in work-factor hash functions
I'm playing around with work-factor hash functions, and I'm looking for a memory-hard operation to make it resistant to GPU / parallel hardware attacks. I considered a very large (i.e. 64K) s-box that ...
6
votes
2
answers
772
views
Is my HMAC secure if I have a complete series of HMAC'd prefix strings
Let's say I have a long sentence, like "The quick brown fox jumped over the lazy dog." Let's further say that I need to keep this string encrypted, so I use an HMAC. Let's further further say I want ...
12
votes
2
answers
11k
views
What are advantages of using a HMAC over RSA with SHA-1 hashes?
I am currently studying for an exam and this was a previous question:
Give one advantage of using HMACs over using RSA to sign SHA-1 hashes.
My thoughts are that it has something to do with the ...
5
votes
1
answer
297
views
Different inner and outer hash functions for NIST-recommended HMAC?
The NIST recommended HMAC uses
$$\operatorname{HMAC}_k(\mathrm{text}) = H_\mathrm{out}( (k \oplus \mathrm{opad}) \mathbin\| H_\mathrm{in}((k \oplus \mathrm{ipad}) \mathbin\| \mathrm{text}) )$$
Is ...
12
votes
1
answer
1k
views
Why does a broken hash function undermine an HMAC?
For instance, what makes MD4 a bad choice for an HMAC? In this case I am asking about MD4 because its less than ideal. I know that a preimage attack can be used to undermine the system, but why? ...
7
votes
3
answers
2k
views
How to authenticate over open channel?
I am making an arduino project to open my garage door. I want to make it so users with the passphrase can open the door. Due to computational restrictions it is unlikely encryption is possible. ...
4
votes
1
answer
491
views
Undecrypt using the OpenSSL EVP API?
I'm writing a client-server encryption scheme for homework, and I've stumbled upon what might be a fatal blow to my current implementation.
When using AES-256-CBC on the two sides, it's important ...
12
votes
4
answers
3k
views
Can I determine if a user has the wrong symmetric encryption key?
We're using the Objectivity/DB object database with a custom encryption plugin that encrypts serialized objects on disk. Encryption uses AES with a shared secret key held by all users. I would like to ...
60
votes
2
answers
19k
views
Why is $H(k\mathbin\Vert x)$ not a secure MAC construction?
If $H(m)$ is a secure hash function, can't we implement a MAC using $H(k\mathbin\Vert m)$?
However, it seems the more widely used MACs, such as NMAC and HMAC (both originally defined in Keying hash ...
3
votes
1
answer
199
views
ID-Secret Scheme
I have an ID-Secret scheme and I'd like to hear if there are any vulnerabilities present.
Party 1 and Party 2 hold some credentials, an ID and a Secret.
Party 1 Creates this message:
...
15
votes
1
answer
2k
views
Security of N bit HMAC
Lets say that I am using 128 bit HMAC. How many operations are needed to find a "non secure" message. Is a birthday attack possible?