Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [hmac]

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

-1
votes
0answers
32 views

Using HMAC for storing low-entropy input data (e.g. SSN)

I am looking for a solution to storing SSNs in a secure way in a database. The following references are related: How to safely store sensitive data like a social security number? https://paragonie....
0
votes
0answers
38 views

Is there a protocol fuzzer or fuzzing framework that uses cryptography?

When reading about fuzzing, the way to go seems to ignore checksums and cryptographic integrity protection or at least circumvent verification procedures via a 'fuzz-friendly mode'. For black-box ...
1
vote
3answers
190 views

How secure is using MD5 for signature

Generally speaking, MD5 is considered as broken for secure usage these days, but I came across a signature design using MD5 many times recently in my company. The detail shows as following: T = text, ...
1
vote
1answer
56 views

Where does last 4 bytes of hmac go in wpa2 mic?

The wpa2 mic is a 16 bytes array which is built by Hmac(sha1) ,But the Hmac(sha1) returns 20 bytes array. So where does that 4 bytes go?
2
votes
2answers
270 views

HMAC and key size

I generated a keyed hash using HMAC-MD5 and HMAC-SHA256 for an arbitrary file with various keys of different lengths. Do we have to use a key with a fixed size in HMAC? If so, what is the key size? ...
0
votes
1answer
41 views

hmac based request signature for verification

say i want an application to integrate my services & need some way of verifying requests from that application, i have an integration key, and a shared secret, i can generate a generate a ...
2
votes
1answer
138 views

Calculating HMAC

I've been trying to learn how HMAC is calculated but seem to be missing something. According to this wiki page, calling HMAC-SHA1 on an empty key and message should result in a value of ...
6
votes
1answer
225 views

Is this vault-less password manager/generator design safe?

Counter The counter is appended to the site name and incremented if you need to get a new password for a site or if the generated password is insecure because it randomly matches something like "...
0
votes
2answers
131 views

Is it reasonable to store HMAC secret key in memory only?

I'm building a web application using Spring Boot for the backend and Angular for the frontend and planning on using JWTs signed with HMAC-SHA256 for authentication/authorization. I've been thinking ...
13
votes
2answers
1k views

How secure is the Ciphersweet library for searchable encryption, and why is a duplicate entry leak not a problem?

I'm currently managing a code base in which we've got a mysql database with all records encrypted using the php-encryption library. This works well for our current setup. We now got a new business ...
0
votes
1answer
97 views

Is AES+hash rather than HMAC problematic?

I will now ask a strange question, but bear with me. I can't share the entire usecase, but the point is to allow the holder of a secret key to create "strings" (used in other systems). The strings ...
2
votes
1answer
56 views

Proof of information having been created before it is released

I have been thinking about the following use-case: some institution wants to organize bets about an outcome that is of its own choosing. The timeline is as follows: The organization chooses the ...
0
votes
1answer
121 views

Is AES + MAC more secure than encrypting plaintext along with its hash

Suppose I want to encrypt some plaintext and I can only use an unauthenticated AES mode like CBC. One way of adding authentication is encrypt-then-MAC, where the two different keys for AES and MAC ...
1
vote
1answer
215 views

KeePassXC & Yubikey HMAC-SHA-1 vs 40+ Character Password

Looking at the implementation of the Yubikey 4 HMAC-SHA1 mode for KeePassXC, I want to know: Isn't the HMAC-SHA1 challenge response less secure than a 40+ character password? From what I know, the ...
4
votes
1answer
328 views

when should i use HMAC-based JWT?

I read a number of blog posts and found that it is tough to keep the secret-key a secret and if using a symmetric algorithm for JWT creation, the generator has the power to create as well as validate ...
0
votes
1answer
172 views

Implementation of PMKID computing function

I am trying to implement a function, let's say in Python to compute Pairwise Master Key Identifier (PMKID) after reading the previously discovered bug in WPA2. Googling gave me this logical statement: ...
0
votes
2answers
127 views

Help to review 2FA algorithm

First of all, I know, don't reinvent the wheel... But there's a good reason for this. So I have been implementing a generic 2 factor authentication code generation/validation algorithm in order to re-...
1
vote
1answer
106 views

Is an HMAC hash of plaintext data secure enough to use as a lookup index for encrypted data

I'm working on an app that will download files from external servers over https and store them on disk in a relatively secure way. Specifically, using a cryptographically unique IV, an AES256 cipher ...
3
votes
1answer
493 views

Why aren’t collisions important with HMAC?

SHA-1 is broken because collisions can be found in substantially fewer hash operations than naive brute-force would suggest. HMAC-SHA1 is fine, however, because for HMAC “collisions aren’t important.” ...
0
votes
1answer
56 views

HMAC and using a cryptographically safe random field as message

Say that I have a big application for which I would like to create a secure API. The standard way to go would be to work with a public API key and a secret API key and provide these to the user. Next, ...
1
vote
1answer
41 views

Use D Parameter Of Private Key as HMAC Secret for JWT in a Load Balanced Environment

I need to use a signature for a JWT that needs to be created or verified on 12 different servers running in a load balanced environment. They all already have the same RSA Key Pair stored in the ...
3
votes
0answers
48 views

Proper way to combine multiple secrets into one HMAC key?

I am using HMAC+SHA256 to sign and verify claims in a web application. Each deployment has its own crypto-random 512-bit secret that I can use as the HMAC key, but in some cases I want to mix in ...
2
votes
1answer
58 views

What advantages would client-side certificates have over signature based auth such as Oauth2 or HMAC for HTTP Requests?

My application currently supports these two authentications methods OAuth2 and HMAC Auth. OAuth2 https://tools.ietf.org/html/rfc6749 HMAC https://tools.ietf.org/html/draft-cavage-http-signatures-09 ...
1
vote
2answers
1k views

Decoding a HMAC SHA256 when the key is the same as the original string

Theoretically, python function for encrypting a HMAC SHA256 looks like this: hmac_sha256(key, text) The word "hello" was encrypted using the function like so: hmac_sha256("hello", "hello") How ...
0
votes
3answers
109 views

Producing secure hashes to detect data manipulation

I have an Android app that internally relies on a SQLite database that stores encrypted user data. The data is encrypted using AES-256, with a key generated by the PBKDF2-HMACSHA256 algorithm. The ...
-4
votes
1answer
84 views

Collision Free and Keyed-Hash Message Authentication Code [closed]

What is Collision Free? And how does it work? What is HMAC(Keyed-Hash Message Authentication Code)? And how does it work? How authentication can be achieved with HMAC?
0
votes
1answer
233 views

Review on encrypted data storage algorithm

I'm building a small command line tool (mostly for fun) that is meant to store data (such as passwords or files) encrypted into a local database, with a user supplied password, pretty much the same ...
0
votes
1answer
242 views

Is nonce of HMAC secured message considered secret?

Consider app using say, HMAC-SHA2, with securely pre-shared symmetric key. Are the nonces of exchanged messages considered secret as well? Or in other words, does its easy predictability or even ...
0
votes
1answer
2k views

HMAC-SHA256 for JWT Token Signature

I am currently working at a company in which we have the need to design a token based authentication system. We will be the owners and controlers of two servers, one being the authentication server ...
1
vote
1answer
2k views

Security tokens for external exposure: UUID or HMAC/JWT/hash?

I'm build the backend for a web app. When a new user goes to the site and clicks the Sign Up button, they'll fill out a super simple form asking them for their username + password and they'll submit. ...
2
votes
1answer
44 views

Clarification on Cipher Suite definition in Wikipedia

Can someone clarify me the difference (or similarity) between data and message described under Cipher Suite in Wikipedia The key exchange algorithm is used to exchange a key between two devices. ...
5
votes
2answers
221 views

Is it secure to use the HMAC of a thing as salt for another HMAC?

Problem I'm trying to explain the full scenario in the next few paragraphs. I think this is important to get some context in which the question is asked, so please bear with me, even if it is a wall ...
4
votes
1answer
276 views

Is appending a salt before hash generation enough

I have what I think is a securely generated salt/hashing mechanism for HMAC authentication based on SHA256 in place. However, I'm using the salt in, from what I can see, a fairly standard way of just ...
1
vote
1answer
58 views

Security difference between web tokens and message signing

I'm seeing two different types of authentication being widely used, with one being far more complex than the other. One are the simple session ID tokens used in most websites (user sends login info, ...
3
votes
1answer
2k views

Securing an API with Django Rest Framework

I'm looking to implement a public (edit: rather, an authenticated api exposed to the internet) API on top of Django, and Django Rest Framework seems to be a popular choice. The APIs that I'm used to ...
4
votes
1answer
543 views

Sending data securely from a microcontroller to a server

I wish to transfer data securely from an arduino (a microcontroller) to a server. The obvious solution is probably to use TLS, but arduino does not have the capability to run it. I did not find ...
5
votes
3answers
705 views

Why would I use MAC over digital signature?

As far as I've read, there is no benefit of a MAC over a digital signature - except the fact that it is faster to generate and process. Is this true? Digital signatures (asymmetric encryption) seem ...
1
vote
1answer
175 views

Is signing safe from brute force attacks?

I am using itsdangerous to sign a string using a secret key. It says that the signing mechanism is HMAC and SHA1 and that it is an implementation of the Django signing module. Assuming I use one ...
1
vote
0answers
48 views

Can we send a forms auth token back from an HMAC API?

We have an ASP.NET MVC application used by people from other organisations. Some of the features are accessible via a forms login. Other features are accessible as SHA256-HMAC-authenticated API ...
-1
votes
0answers
52 views

Is it bad to embed known string in signed token?

My REST API can deliver JSON Web Tokens to my app. The tokens gives the app opportunity to download files at a later stage. The files to be downloaded are identified by a UUID. The UUID of the file ...
1
vote
2answers
3k views

Using Hashcat to crack HMAC-SHA256

Hashcat boasts its ability to crack over 200+ hashing algorithms, but there isn't much documentation on much of them. Hashcat --help shows it has support for HMAC cracking, but its not very ...
1
vote
1answer
136 views

Does TLS 1.0/1.1 server sign the message digest with its private key?

After a TLS-enabled server generates a message digest (HMAC), does it sign the digest using the private key of an asymmetric key pair, forming a digital signature? I'm more interested in knowing ...
2
votes
1answer
72 views

Are RFC 2104 and FIPS 198 compatible with each other?

Is the FIPS 198 specification of HMAC compatible with the RFC specification for HMAC?
1
vote
1answer
86 views

Can a TLS HMAC be used after the fact to verify the authenticity of a message? [duplicate]

If I were to capture a TLS session (and shared secrets) between myself and a web site operated by another party, could I later use the HMAC (or something else?) to verify to a third-party the ...
0
votes
1answer
45 views

Secure message transportation [duplicate]

It is secure to use the shared secret as the key for a HMAC? is it better to derive one key for all of the messages that are going to be HMACed or a key for each message? Is it safe to use the shared ...
3
votes
2answers
183 views

Proper HMAC Usage

I just read this article, which is a top 10 list of developer crypto mistakes. In number 7, he states that "HMAC should not be applied to the plaintext but instead to the ciphertext combined with the ...
1
vote
3answers
120 views

Can HMAC confirm message existence?

I was looking into HMACs and was wondering if a HMAC can verify the existence of a message. I need to verify another host is (still) holding a large piece of data. I plan to send the host a key and ...
-1
votes
4answers
1k views

Theoretical - Password salting with concatenation vs. salting with HMAC

I was looking through different methods of salting and tried to compare which is more secure for password storage. I know HMAC wasn't meant at first for password hashing but it is widely used for that ...
3
votes
1answer
577 views

Vulnerabilities of using HMAC of random ID as shared secret?

Assume that a server has a random secret key, uses it to generate <id = random(), secret = hmac(id, key)> credential tuples, and hands these <id, secret> tuples out to clients freely (over ...
0
votes
2answers
602 views

Securing non-consumer machine-to-machine APIs with Encryption over SSL

I'm working on an API that is intended to be consumed by another system. The data is not owned by the requesting machine and the user(s) that the data pertains to are not driving the transaction. You ...