Questions tagged [hmac]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
21 views

How to use public keys with asymmetric cryptography to dynamically create a shared secret for HMAC?

I have a mobile app (iOS and Android) and I'm trying to implement HMAC with Node.js as the backend. Currently I have a static shared key for symmetric HMAC(e.g. "ABC123") which is hardcoded in both ...
0
votes
2answers
92 views

How to protect HMAC key embedded in code from someone who would copy entire source?

I and a friend are developing a web game. The front-end to back-end communication will be carried out by the means of an API. We realized that someone could then easily hook up to our API and make a ...
0
votes
1answer
41 views

Can I securely share an HMAC key over a TLS connection?

In a game client/server that I'm developing, I want to allow a user to authenticate over TLS (via a REST endpoint on an HTTPS server) before dropping to an unencrypted low-latency UDP protocol. To ...
7
votes
3answers
7k views

What is a AUTH-KEY in the security of the computers?

I'm studying security in computers and in particular the URL Spoofing. I understand that a form of URL spoofing is phishing. Then I read that a countermeasure against phishing is the authentication ...
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 ...
5
votes
3answers
3k views

Want to implement a really good authentication mechanism for REST API

I own a web application (single page application with Angular), that asks for some data through a set of REST APIs based on my server-side application (using Play Framework 2.2.1). So basically, I'm ...
131
votes
5answers
161k views

How and when do I use HMAC?

I was reading HMAC on wikipedia and I was confused about a few points. Where do I use HMAC? Why is the key part of the hash? Even if someone successfully used a "length-extension attack", how would ...
5
votes
1answer
664 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
0answers
40 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
213 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, ...
4
votes
1answer
553 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 ...
226
votes
7answers
82k views

Password Hashing: add salt + pepper or is salt enough?

Please Note: I'm aware that the proper method for secure password storage hashing is either scrypt or bcrypt. This question isn't for implementation in actual software, it's for my own understanding. ...
1
vote
1answer
65 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
549 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
74 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
244 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
246 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
198 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 ...
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 ...
0
votes
1answer
120 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
314 views

The application of HMAC vs CMAC vs DAA

So HMAC, CMAC, DAA are different algorithms for generating MAC based symmetric block ciphers. If all use symmetric ciphers to produce MAC, what is the key difference between them? In other word, why ...
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
127 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
262 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 ...
3
votes
2answers
418 views

Securing ASP.net web api (REST) [closed]

I am developing a middle-ware web service app (REST) using ASP.net MVC-4 web API. The rest services are consumed by android, ios, angularjs client apps. The same user is able to use multiple ...
1
vote
3answers
6k views

Validate hmac with hashed stored key

What if an HMAC is correctly generated and sent with the data to the server, so far I know the server needs to know the original data with which the MAC was created in order to re-create the MAC and ...
0
votes
1answer
215 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: ...
6
votes
2answers
257 views

Securing a JavaScript app with RESTful backend

I went through the question Securing a JavaScript Single Page App with RESTful backend that has discussions / options around securing a Javascript client side app that invokes RESTful APIs. However, ...
0
votes
2answers
130 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
120 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 ...
42
votes
2answers
57k views

What's the difference between HMAC-SHA256(key, data) and SHA256(key + data)

Is there anything different about how secure these two hashing algorithms are? Does HMAC "fuse" the data and the key in a special way that's more security-aware?
6
votes
1answer
471 views

MasterSecret expansion into keys

I'm trying to deeply understand the steps during a TLS handshake. I've read this answer (which is btw pretty complete), but I still got a question about the utilization of the MasterSecret, in the ...
0
votes
1answer
64 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
44 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 ...
5
votes
3answers
793 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 ...
4
votes
0answers
60 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 ...
1
vote
1answer
181 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 ...
0
votes
1answer
234 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 ...
2
votes
1answer
59 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
3answers
918 views

Data integrity and authentication of an Arduino using JSON Web Tokens and HMACs

I have a school project involving an Arduino-based sensor that needs to send sensor readings to a server via HTTP. The sensor readings do not need to be encrypted (it's okay that people know what they ...
1
vote
2answers
2k 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
122 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
93 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
270 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 ...
4
votes
1answer
296 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
2answers
159 views

Ensuring integrity of broadcast messages between known network nodes

I need to share data between N network nodes in a given network. The N network nodes are all mine, but apart from them it is possible for any device to connect to the same network. There is no master ...
8
votes
1answer
8k views

HMAC solution for a rest API

I'm trying to learn some things about REST apis and one of the topics that I'm having some trouble is security. I'm using angularjs for web interface ans slim framework for the php api. I've read ...
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
3k 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. ...