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
1
vote
0answers
15 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 ...
2
votes
1answer
37 views

AES-128/CTR/NoPadding HMAC vs Signature

Is there a semantic difference between tagging AES_128/CTR/NoPadding ciphertext with an HMAC or Digital Signature (SHA256withRSA)...
0
votes
0answers
8 views

customize output of command “openssl dgst -hmac” [migrated]

I want to compute the HMAC of file A.txt and put it into file A_hmac.txt. I use openss library, now I have: ...
0
votes
1answer
41 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$ ...
2
votes
2answers
73 views

How to correctly implement an archetypal encrypt-then-MAC AES-CTR + HMAC mode cipher?

I've created an AES implementation in Python as a learning experience (mainly for encrypting/decrypting files), and wanted to make sure that I haven't made any huge mistakes in my logic (of course, ...
2
votes
1answer
59 views

HMAC256(K,m) vs HMAC256(K,K)

I have a key size of 128 bits. My message size is fairly short (e.g., 32 bits - and widely known). Although I am doing a SHA256, the result of the HMAC will be truncated to 128 bits. So my question is:...
3
votes
0answers
50 views

Does the security proof of HMAC somehow change if it's instantiated with sponge-based hash functions with small rate and large capacity?

HMAC was introduced in [1], as a MAC that has its security proof based on the properties on the underlaying hash function. The hash functions considered in that paper were ones based on the Merkle-...
1
vote
1answer
52 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 ...
2
votes
1answer
50 views

Is is safe to use MtEtM? (MAC-then-Encrypt and Encrypt-than-MAC)

Assuming I am using different secrets/keys for each MAC pass, does running both MtE and EtM creates any vulnerability? This is what I mean about doing MtEtM: ...
2
votes
0answers
34 views

How are ChaCha-based ARC4Random CSPRNGs initialized and reseeded?

I'm doing a spare-time project to collect cryptographic algorithms, implement them, and lastly benchmark them. For the CSPRNG part, I'm evaluating NIST-SP-800-90Ar1 HMAC-DRBG and CTR-DRBG (Hash-DRBG ...
2
votes
1answer
52 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 ...
3
votes
1answer
35 views

Is HKDF one-way, namely given `Ko` it's hard to guess `Ki`?

For background, a HKDF (hmac based key derivation function) takes the form of Ko = KDF(Ki, Label, Context, Len) where Ki is the ...
2
votes
2answers
96 views

Prove that you have the data when hash is public

I am designing an online service where users can upload files (3d models) for processing. I want to speed up things when the same file is uploaded by many different users by allowing them to post a ...
2
votes
1answer
40 views

PBKDF2-HMAC Collisions

Trying to understand the well known property of these collisions when used with SHA1, SHA256, etc. where a given key is larger than the block size of the digest function. In these cases the smaller of ...
3
votes
1answer
82 views

Create a TOTP for machines using HMAC or AES

I'm trying to create a sort of Time-based One Time Password (TOTP) where machines are involved (not humans). In this kind of TOTP the step is 15 minutes between one code to the next one and both ...
2
votes
1answer
71 views

Is an HMAC based on a second-preimage resistant hash function always unforgeable?

If hash function is collision-resistant, then its associated HMAC is always unforgeable. But suppose that a hash function is only second-preimage resistant, not necessarily collision-resistant. Then ...
-1
votes
2answers
86 views

Does HMAC support or guarantee confidentiality? [closed]

I know that HMAC supports or guarantees both authentication and integrity, but does it also provide confidentiality?
1
vote
2answers
53 views

Break HMAC-SHA256 of PAN with known hash?

Imagine a database containing hashed (HMAC) Primary Account Numbers (PANs ) and associated identifiable information (e.g. transactions). Consider a data breach. Prior to the breach, an attacker made ...
1
vote
1answer
98 views

Is it acceptable to use a HMAC-SHA256 hash as a secp256k1 private key?

Say I want to generate a deterministic private key related to some data, for instance to a domain name. The easiest way I can think of is: take a secret material which will work as "generator&...
1
vote
1answer
69 views

Authenticated, Quantum-resistant GPG2?

GPG2 does not provide authentication. It still uses SHA-1 by default. It does not seem to get any stronger as time goes by. If one were to pass a randomly-generated symmetric key (from a TRNG) over ...
0
votes
1answer
45 views

Is it safe to use the same password/secret for both VeraCrypt volume and its HMAC?

I am trying to script the integrity check of a VeraCrypt volume. ...
3
votes
2answers
120 views

Extending AES-GCM initialization vector

We all know that applications of crypto primitives like to not think about the management of nonces, and initialization vectors and often prefer to just set them to random values. This sometimes leads ...
5
votes
1answer
579 views

How is it possible that these two encryption functions yield the same result?

I opened this post in stackoverflow some time ago where I explained a problem I had about not finding a way that would allow to successfully get the result of a string encrypted with a "aes-256-...
1
vote
1answer
55 views

HMAC SHA256 - fixed vs dynamic key - security and collision impacts

Assume we should apply an hmac sha256 on different messages made of incremental numbers (Ex. 1 to 1 billion). Does it make sense in terms of security to apply a different fixed key for each message? ...
3
votes
1answer
102 views

With AES encryption and a known key and plaintext, can an attacker create a different key and plaintext resulting in the same ciphertext?

In short: with AES encryption can an attacker create a new key2 and plaintext2 so that AESkey1(plaintext1) = AESkey2(plaintext2) If so, can it be solved by just applying for instance a MAC like AES-...
2
votes
1answer
48 views

HMAC for hash list

If I have a very large input to hash with a hash function vulnerable to length extention and I am using a hash list, should I HMAC each part of the input or just HMAC the final hash of all the hashes ?...
0
votes
1answer
68 views

Using HMAC with AES modes that do NOT require padding [closed]

I'm trying to use HMAC with AES modes that do not require any sort of padding. Although I am aware that modes like AES-GCM and ...
6
votes
1answer
95 views

OpenSSL FIPS integrity check

As far as I know, FIPS requires a set of self tests (POST) to verify the cryptographic algorithms permitted and the integrity of the module. These tests are performed at run-time, so OpenSSL does a ...
2
votes
1answer
64 views

What is the best way of deterministically choosing N of M, given 32 bytes of sha256?

I have a list of M=10,000..100,000 items and 32 bytes of sha256 H. I want to choose N=10..100 items (without order). Is there an efficient way to do this? Or should I use something like ...
2
votes
0answers
44 views

Why the salt is used as a key in the extract phase of HKDF?

What is the reason that in the HKDF standard (RFC5869), in the "extract" phase, the 'salt" parameter is instantiated as HMAC key, and the secret keying material 'IKM' is instantiated as HMAC input ...
1
vote
1answer
66 views

Is it okay to reuse a single symmetric key for a large volume of messages and HMACs, so long as “nonces” are randomly generated for both of them?

https://www.reddit.com/r/crypto/comments/fnku50/nonce_reuse_vs_iv_reuse/ Nonce reuse with the same key is catastrophic to security. The same premise holds for initialization vectors. If the key ...
1
vote
0answers
26 views

Integrity for mixture of encrypted/unencrypted database fields

I have multiple blobs each (symmetrically) encrypted with its own randomly generated key. Now I want to encrypt these blob keys with user keys and store them in a database. A table could have the ...
2
votes
1answer
94 views

Why Authenticated Encryption the same message again is not secure?

It is the Exercise 9.14 (9.1) from the book A graduate course in applied cryptography by Boneh and Shoup. Let $(E, D)$ be an AE-secure cipher. a. $E_1(k,m):=(E(k,m), E(k,m));$ $$D_1(k,(c_1,c_2)):= ...
1
vote
1answer
70 views

does using an HMAC protect against hash table DoS attacks?

For a hash set where the values are supplied by a third party, one concern is that an attacker can run a denial of service attack by creating many values that all fall into one bucket of the hash ...
2
votes
2answers
141 views

What is the difference between a PRF and a PRP, and are cryptographic hash functions the same as HMAC (PRFs or PRPS)?

I read one answer to a similar question that put forth that a hash function is distinct from a PRF, however I've also found materials purporting that cryptographic hash functions are PRFs, and I'm not ...
1
vote
1answer
69 views

Is it possible to affect the output of HMAC w/ SHA-512 by providing it with a custom message?

Consider an HMAC algorithm that uses SHA-512 with an unknown private key. Is it possible to affect its output, either partially or totally, by providing it with carefully crafted messages? For the ...
2
votes
0answers
69 views

Why is double encryption used to generate EphIDs in DP3T?

The most famous proposed COVID-19 application is DP3T. In this app a user constantly broadcasts EphIDs generated from a secret key as follows: $$EphID 1 || ... || EphID n = PRG( PRF(SK_t , “broadcast ...
0
votes
0answers
92 views

How to generate temporary Credentials for TURN server Using TURN REST API in Java

I am new to this site, hence I apologize for my English and way of phrasing the question. I am trying to generate temporary credentials to my TURN server using the TURN secret that I generated with ...
2
votes
1answer
125 views

Does pepper *require* an HMAC?

Assume you are already given a properly-salted, password hash $X$ from some slow PBKDF (e.g., like Argon2id). Now, you want to apply some large (~256-bit) secret "pepper" $S$ to it before storing it ...
0
votes
1answer
36 views

how to predict a sequence for reverse engineering of a ticketing system [closed]

i am student in the fith year of college IT-science and a crypto noob. i have been wondering how the folwing sequence of ticket i bougth in all at once were built for : how they work or how they are ...
1
vote
0answers
304 views

How to bruteforce password from HMAC-SHA256 hash (if you have the key)?

Short of creating one's own script / program, is there an existing, readily available way of iterating through a list of potential passwords to find which one corresponds to a hash (HMAC-SHA256), ...
2
votes
1answer
76 views

Key at start or end of HMAC

In the book Information Security Principles and Practice, the author explains why HMAC should be used for integrity with a symmetric key with the message, to prevent a MiTM to replace both the message ...
2
votes
1answer
240 views

SHA1 standard steps

I'm a computer engineering student and I want to implement a cryptographic function for a college project. I want to realize my personal implementation of a WPA2 hash producer in C (and upload it to ...
1
vote
2answers
131 views

Can a MAC be used as a HMAC?

I am reading through an information security book right now, and a confusing question poses itself to me: "Could you use a MAC as a HMAC? That is, does a MAC satisfy the same properties that a ...
8
votes
1answer
1k views

How many codes can I safely generate using the same HMAC key?

Can an attacker guess the key given enough codes for the same key? And if so, how many times is it safe to use the same key?
1
vote
2answers
242 views

How to design a secure challange-response authentication protocol?

I am implementing a custom challenge-response protocol to authenticate a client to a server. Mutual authentication is not required, i.e. the server doesn't need to be authenticated to the client. The ...
0
votes
1answer
58 views

Using the output of HKDF directly

I am using HKDF with an IKM and salt, the OKM is used as the key for an HMAC operation. The HMAC algorithm is authenticating messages in a communications system The salt is the concatenation of 2 ...
0
votes
1answer
173 views

Length extension attacks, Merkle–Damgård constructions, and HMACs

The wikipedia page for Length Extension Attacks says "Note that since HMAC doesn't use [Merkle–Damgård constructions], HMAC hashes are not prone to length extension attacks." However, HMACs can be ...
-1
votes
1answer
57 views

How to implement nonce for hashing a 6 digit sensitive number with hmac with its secret key

I have to pass a 6 digit number which has to be kept very secret through a unsecured netwok. I am thinking to hash it using hmac and a secret key which only me and the reciever knows So the code ...
1
vote
1answer
55 views

can I use PBKDF2 instead of hmac as a hashing tool for sensitive data

I have read about hmac and PBKDF2. PBKDF2 - is mainly used for password hashing. It uses ...

1
2 3 4 5
11