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

learn more… | top users | synonyms

1
vote
1answer
27 views

Can I use HKDF to improve security of HMAC used with weak hash function?

I am writing a framework which encrypts/decrypts files (or streams, in general) with symmetric key using block cipher (for example, AES). To authenticate encrypted file, I use HMAC, which is ...
2
votes
3answers
70 views

Establishing encryption key using shared secret

I need to establish some security on a network of 8 bit microcontrollers. very limited RAM, CPU and packet sizes. I have zeroed in on a shared secret based scheme. Setting up shared secret is out of ...
1
vote
0answers
29 views

HMAC for encrypted authentication token: recommended iteration number [duplicate]

In the web application I use 10,000+ iterations for hashing passwords stored in database (random salt and all). Password-related operations are not frequent enough to create a noticeable performance ...
2
votes
2answers
258 views

Why is HMAC-SHA1 still considered secure?

This Q & A http://security.stackexchange.com/questions/33123/hotp-with-as-hmac-hashing-algoritme-a-hash-from-the-sha-2-family says that the security of HMAC-SHA1 does not depend on resistance to ...
1
vote
1answer
43 views

How is wpa2 authentication structured

I would like to understand the cryptography behind Wpa2. As far as I know, there are 4 messages on the 4-way handshake and three of them are values concatenated with hashes. First, I am trying to ...
6
votes
2answers
204 views

Is the HMAC construction really neccessary for a fixed length message?

The HMAC Construction is defined as: Hash( (Key XOR opad) || Hash((Key XOR ipad) || Message) ) This was designed because a simpler construction such as: ...
2
votes
0answers
56 views

DPA Attack on HMAC SHA-256

I have read the paper Differential Power Analysis of HMAC SHA-2 in the Hamming Weight Model and I want to understand the DPA Attack. In section 3.2.1 Path 1 (page 4) there is written: The last ...
0
votes
1answer
36 views

Encryption(AES) and verification per message

I want to send/receive messages with A (an peer) using TCP socket. I want to encrypt messages using AES CBC. Only I and A know a symmetric key K1 used in AES CBC, and K2 used in HMAC. The size of each ...
0
votes
1answer
67 views

Using HMAC SHA256 to protect payment files in local trusted network

in a project that I am working on we have been tasked with eliminating PGP while providing sufficient security to protect payment files only within the Company's trusted network. We arrived at HMAC ...
0
votes
1answer
34 views

How HMAC.Update function works?

I know how standard HMAC(key,msg) function works, and I want to write a Delphi port of HMAC class that implements Update function. The problem is that I don't understand how this Update function works ...
20
votes
3answers
850 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 ...
1
vote
1answer
39 views

sha256_hmac for session keys using a counter

I need to generate some session keys from a master key that was generated from an ECDH key exchange. The master key is 256 bits and I need 256 bit sessions keys. Is it safe to use SHA256_HMAC with ...
1
vote
1answer
36 views

Differences between HMAC and HKDF in a specific case

I want to use a key derivation function to derive a key to another one. I think HKDF is the easiest solution in my case. The following picture gives a clear definition of it : ...
6
votes
2answers
282 views

Is HMAC-MD5 still secure for commitment or other common uses?

MD5 collisions have been out for some time. In spite of this, HMAC-MD5 is still secure for authenticating data1. This illustrates a strength of the HMAC construction, it does not require that the hash ...
1
vote
1answer
50 views

HKDF entropy extraction

I collect entropy from the following sources: system_entropy = System provided crypto entropy stream (CryptGenRandom on Windows) user_entropy = User-provided entropy - in a form of a byte stream of ...
1
vote
1answer
34 views

Could this alternative hash based MAC construction be as, or even more secure than an HMAC?

Begin hashing (Key||Message) Encrypt the hash state (or some part of it, such as the first 128 or 256 bits), with the key. Add the encrypted hash state to the ...
2
votes
1answer
78 views

Authenticate a short message with redundant encryption instead of using a MAC?

I have a short message that’s exactly 128 bits of length. The message serves as a time-limited authorization token for a database. It contains a permission profile ID (64 bits) and an issue timestamp ...
11
votes
1answer
3k views

Is HMAC-MD5 considered secure for authenticating encrypted data?

I've read something to the effect that the HMAC construct is able to lessen the problem of collisions in the underlying hash. Does that mean that something like HMAC-MD5 still might be considered ...
5
votes
2answers
196 views

How is HMAC(message,key) more secure than Hash(key1+message+key2)

I understand how for hash functions which are vulnerable to length extension attacks (such as SHA1 and SHA2) it is safer to use a HMAC construction. What I don't understand is, how or why is ...
2
votes
2answers
117 views

PGP digital signature vs SHA256 HMAC Comparison

First let me admit that I am not a mathematician or a cryptographer. I am responsible for assisting in making a recommendation on a project that is consolidating payment processes within a company's ...
0
votes
1answer
58 views

How is the MAC or HMAC secret shared with the other party for verification?

I've seen people everywhere say to use a MAC or HMAC with block ciphers. I think I understand the basics, but I'm still not sure how the HMAC secret is distributed so the other party can verify that ...
23
votes
2answers
3k views
0
votes
0answers
41 views

why are both ipad and opad required for HMAC? [duplicate]

I was reading about HMAC and why it is crucial to avoid security issues with normal prepending / appending the secret k to a message (issues due to merkel damagard construction). I am not familiar ...
0
votes
1answer
46 views

if using cbc+hmac dealing with small size of data(less than 128bit) , will it cause any problem?

if use AES-cbc,HMAC-SHA256, and there is some txt needed to be enc, and I divide this txt into small packages with variable length, then enc them. some of these package can be less than 128bit. Is ...
1
vote
2answers
130 views

Generate secure password hashes without access to PBKDF2 or bcrypt

Given is a system, which does provide only implementations of fast hash algorithms (MD5, SHA1, SHA-256, SHA-512). There is no implementation of PBKDF2, bcrypt or scrypt available. The system does ...
0
votes
2answers
151 views

CTR HMAC SHA256 implementation

After trying to invent my own AES mode, I decided to just implement something that's known to work, namely CTR with HMAC SHA256. From what I understand, I can use the IV as a counter, and the IV ...
2
votes
1answer
126 views

New to cryptology, studying Message Authentication Codes

I understand the basic operational theory behind MAC, but I'm getting tripped up on some of the finer details. Also the differences between MAC, HMAC and MIC are getting lost on me, including the ...
1
vote
2answers
158 views

What is the best hash for HMAC?

Long question but I am starting to lose sight of all the HASH algo's there are. I know SHAKE128 and 256 are part of the SHA-3 standard but is the SHA3 standard officially released yet? i can only ...
0
votes
1answer
58 views

HMAC tag to verify the key (verification in the reverse direction)

A quick question. Are there any problems with the following HMAC use-case: We have two entities ($A$ and $B$), both of them have a secret ($A$ has $S_0$ and $B$ has $S_1$) $A$ generates a random ...
1
vote
1answer
61 views

Security of integrity protection with HMAC vs AEAD

I'd like to know how the security of the integrity protection compares between: HMAC-SHA-256 with an 32 byte tag or a truncated 16 byte tag AES-GCM with a 16 byte tag AES-CCM with a 16 byte tag or ...
9
votes
2answers
674 views

Encrypt-then-MAC: Do I need to authenticate the IV?

In the setting of Encrypt-then-MAC, do I need to include the IV in what I'm HMACing, or is authenticating just the AES-encrypted data sufficient?
0
votes
0answers
41 views

Separate keys for encryption and MAC? [duplicate]

I use HMAC(ciphertext)+ciphertext for authenticated encryption. The same key is used for both MAC and encryption. Is that right? Is using separate keys for MAC and encryption necessary or any good? ...
0
votes
1answer
65 views

If you know the messages, and the results of HMAC(key, message) can you find the key?

If the attacker has 1 billion 4KB (random-noise) messages and sha256-HMACs for those messages (all using the same key), can they calculate the key that was used, before the universe dies?
1
vote
1answer
73 views

Is the result of HMAC-sha256 distinguishable from random noise?

Is if the result of HMAC-sha256 distinguishable from random noise? If so, given: a collection of 1000 keys, and 1000 messages of random noise, 100 signed by each of only 10 of those keys Can ...
0
votes
1answer
48 views

Using hashed password as shared secrets. Good or bad idea?

I built a system that allowed users to generate an unlimited number of email addresses. Instead of storing each one in a db, I created addresses dynamically and made the address an hmac signed ...
1
vote
2answers
99 views

Equivalent key size between HMAC and AES?

I have seem comparison between AES and RSA, e.g., AES 128 bit key is equivalent to RSA modulus 3072 bits. Is there such comparison between AES key size and HMAC?
0
votes
1answer
64 views

Hashing - Digital Signing and Trivial Stretching

Two very basic questions: 1. Digital Signing Why is it not possible to just simply replace the hash value from the request? Examples: ...
0
votes
1answer
41 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
146 views

Is the output of AES-CBC + MAC the same size as the input?

I use AES-CBC and HMAC-SHA256 to encrypt a text file. Will the output be larger in size than the input or will it be the same size? Is it more secure secure if the size of the output is larger?
0
votes
1answer
62 views

wireless network security protocol

In network security, encryption and integrity done by the same algorithm that is AES-CCM in that MIC generated by CBC-MAC and encryption done by CTR mode. So suppose I want to do encryption with any ...
0
votes
3answers
103 views

Updating the secret key used for HMAC

I am designing a distributed system, composed by a set of physically distributed embedded devices (8 bit cores with less than 1 KB of RAM). The devices need to be able to authenticate the originator ...
1
vote
0answers
72 views

Performing HMAC with random key before MAC comparison

In Laravel (a PHP framework) I can see that they calculate a HMAC with a random key over the final HMAC before comparison. This additional HMAC calculation is of course performed for both the ...
0
votes
1answer
181 views

How to implement HMAC SHA-256

I am trying to figure out how the HMAC SHA-256 hashing algorithm works. I know that we have to use the following: H (K ^ opad)|| H ((K ^ ipad)|| text)). The ...
0
votes
1answer
58 views

Integrity protection in wireless sensor networks [closed]

I have done a lab about wireless sensor nodes and got in touch with encryption for the very first time. There are some questions on my sheet, especially on integrity protection (the attacker wants to ...
0
votes
1answer
51 views

Adding a Password Hash (key derivation) function to existing password storage solution

As always we are trying to improve password storage; before just adding new ways of storing our password we need to define what threats we will mitigate by adding in a new way to store our password. ...
0
votes
2answers
47 views

How to use HMAC for authenticating multiple messages

The standard HMAC function, $H(K, m)$, authenticates a single message $m$. Instead, I'd like to authenticate 2 messages, like this: $$H'(K, m_1, m_2)$$ The simplest solution, $H(K, m_1||m_2)$, ...
2
votes
2answers
141 views

secure embedded/microcontroller crypto using AES-ctr with hmac-sha2

The embedded device is a low-power 8-bit microcontroller (memory usage is constrained to about 10kb code, 1kb ram). As the device is battery-powered and manual service should be minimal, more powerful ...
0
votes
1answer
191 views

Encryption and HMAC in a PSKC file

This is the PSKC standard https://tools.ietf.org/rfc/rfc6030.txt In Section 6.1 6.1. Encryption Based on Pre-Shared Keys They have the following ...
3
votes
2answers
100 views

How many times can a key be used for HMAC-SHA256 before it needs to be rotated?

If I wanted to use hmac for proving that a value hadn't been tampered with, how many times can I use a key before it needs to be rotated?
0
votes
1answer
76 views

Specific example of a MAC in TLS?

This seems like quite a dumb question, but I really don't know if I'm finding a answer anywhere. I understand that if i access a website that is secured with TLS, we exchange ciphersuites and so on, ...