Questions tagged [hmac]
a method for constructing a message authentication code based on a cryptographic hash function.
288
questions
1
vote
2
answers
47
views
Why does TLS use two separate sequence numbers?
In TLS separate implicit sequence numbers for sent and received packets are used to calculate the HMAC in the record layer. The RFC 5246 says:
Each connection state contains a sequence number, which ...
1
vote
1
answer
256
views
CSRF: Signed Double Submit Cookie & 'Referer' validation vs MITM and vulnerable subdomains
I have been researching various techniques for preventing CSRF attacks, such as SOP, SameSite, Secure, Referer validation, and CSRF Tokens, and their potential bypasses. During my research, I ...
0
votes
1
answer
220
views
Session based CSRF Tokens - What value do i use with JWT?
The Double Submit Cookie CSRF Token pattern is a stateless technique that doesn't require storage or a database. However, it's vulnerable to session hijacking attacks and sub-/sibling domains that are ...
1
vote
1
answer
55
views
javascript: how to apply block cipher to byte stream
I am writing browser javascript that has a pre-shared key with nonce, and creates a binary websocket connection. How can I apply block encryption-authentication such as AES-GCM to the messages?
Is it ...
2
votes
1
answer
107
views
I using sha256 after adding a secret enough if the message includes its length?
I've been reading about HMAC protecting from length extension attacks, but if the message already specifies it size, is HMAC adding any advantange to simple hashing after prepending a secret?
As ...
2
votes
0
answers
91
views
What would be the most complete procedure to get a simple login system working securely?
I don't have formal CS education but i've written one or 2 little websites. I have troubles communicating even in my native language but i hope this is understandable.
With simple i mean something ...
0
votes
1
answer
263
views
Key derivation for HMAC, concatenate vs multiple HMAC passes
I'm trying to build a generic function to encrypt HMAC values with a single global secret key, but that can be "scoped" or salted by application/uses. For instance, an HMAC for a session ...
0
votes
1
answer
185
views
Is an HMAC of an email address with a permanent secret key a good way to generate security tokens for unsubscribing from an email list?
I'm writing a mailing list manager program. For subscribing and unsubscribing, I'm considering using HMACs of email addresses with secret keys to generate unsubscribe links. This key would be ...
0
votes
1
answer
186
views
Is is safe to pass an API key in a HMAC hash?
I have 2 websites: a.com and b.com
To avoid using SAML for Single-Sign-On and making things complicated, I've taken this approach:
a.com is the identity provider. All users will be asked to sign in on ...
1
vote
0
answers
310
views
What exactly happens when you use 2FA with "Password" + "Yubikey HMAC" Login in KeepassXC?
Usecase: KeepassXC is configured with a Passward + Yubikey HMAC.
I am trying to understand the exact steps that happen.
I think the first five Steps are clear:
Open KeepassXC
Enter Password
Select ...
1
vote
0
answers
329
views
How exactly does OpenVPN's tls-auth option apply HMAC to packet messages?
Update: I've been able to work out everything I was asking about packet structure when I was finally able to get Wireshark to work, but there is one last thing I'm confused on which I detail at the ...
0
votes
1
answer
139
views
How does HMAC fit in BLE?
In BLE there is events like authentication, pairing, bonding, exchange of LTK to secure a link, etc...
How does HMAC fit in BLE? I know that HMAC is used to ensure the integrity of a message so does ...
0
votes
0
answers
213
views
Why we need complicate truncation for the OTP?
If we assume that Time based OTP generates the OTP using the hash function like SHA-3. Then, the generated OTP would Hash(Secret, Shared time).
We want a shortened string rather than a full hash ...
1
vote
1
answer
900
views
HMAC SHA256 by using a static key + text as a key
Maybe it's not a good idea, but I would like to check it with you.
When using HMAC SHA to hash a clear text value (string max 30 char) I need to use a key (256) but in my scenario this key is static ...
0
votes
2
answers
388
views
Digital signature for API authentication feasible?
Could it be practical to authenticate API request through digital signature (based on headers and message body)? This would be asymmetric instead of something like HMAC which is not a signature. ...
2
votes
2
answers
189
views
Am I authenticating devices securely?
I'm building a IOT platform for my home as a hobby. Currently, I'm trying to implement device authentication. A device in my case could be a Raspberry Pi, Arduino, Jetson Nano. To authenticate devices ...
0
votes
0
answers
60
views
Usage of HMACs to verify the licensing during production
We have a production that uses our software (put on a chip) and a requirement that we need to limit the amount of chips produced for each customer (so they need to buy a license) - so they can't ...
0
votes
1
answer
262
views
How does TLS use hashing from the negotiated cipher suite
I am trying to understand why TLS only uses hashing algorithm like SHA-384 instead of using an HMAC instance like HMAC-SHA-384.
If I understand correctly, this cipher suite (...
2
votes
2
answers
171
views
Benefits of HMAC-based server authentication
Context and assumptions:
TLS 1.2 or 1.3, server authentication only
Client uses HMAC to authenticate itself to the server, using a PSK key
Client is a library, not a web browser, which doesn't allow ...
0
votes
1
answer
660
views
HTTP authentication with client-side private key
I'm designing a web service meant for storing data for users, but these users don't have proper server-side accounts, just a random master key the user generated and stores on their device (a bip39 ...
2
votes
0
answers
506
views
HMAC hashing vs JWTs for stateless authentication
For simple authentication with backend services, without more sophisticated needs (e.g. roles and scopes), is there any security benefit in using JWTs instead of sending HMAC hashes to verify a ...
0
votes
2
answers
260
views
Is it feasible to calculate an HMAC-SHA512/256 MAC from an environment that only supports HMAC-SHA512?
I need to verify a MAC for something signed with HMAC-SHA512/256, however, the language I'm using (Salesforce's Apex language) doesn't have support for that algorithm. It does have HMAC-SHA512 and ...
0
votes
2
answers
291
views
Keyed Hash Function (HMAC) For Unguessable URLs?
I have numeric IDs that I would like to use in filenames. So for example with IDs 1, 2, 3 we would have 1.jpg, 2.jpg, and 3.jpg
Now the problem is that clearly a user could just guess 4.jpg and view ...
0
votes
1
answer
187
views
Combining confidentiality, authenticity and data integrity to form secure URL
There are clients (mobile application), they can share links to their profile info, which should be confidential. The link expires in 5 minutes (configured). They set Auth-Code so that the one who ...
2
votes
3
answers
1k
views
Is a simple random+hmac session cookie breakable?
I make session cookies of form session_id+'|'+hmac_sha256(session_id, static_secret) where session_id = random_string(16 bytes) made with a PRNG (not a CSPRNG!) seeded on the server's timestamp at ...
0
votes
2
answers
131
views
Does using subkeys provide better protection in this instance?
I was thinking of implementing the following scheme for encryption of many independent files:
From the password, which is given by the user, generate a master key using for example HMAC-SHA.
From ...
0
votes
0
answers
442
views
Best secure approach with Basic Auth
Due to several customer reasons our product needs to support Basic Auth as primary authentication mechanism with client's service account.
We are using Bcrypt to store customer's password in our DB, ...
0
votes
1
answer
2k
views
REST API is protected by HMAC based authentication. What does including URL path in the message protect from?
I have came across a REST API for some commercial software, that checks authentication by requiring HMAC on concatenation of
http_method (GET, PUT, etc)
timestamp
payload (body of a POST / PUT ...
1
vote
0
answers
1k
views
How to uses FIDO2 hmac-secret extension for offline authentication? [closed]
How hmac-secret extension defined in the CTAP2 Specification is used to help implement offline authentication with an authenticator. Is there any other specification that says how to do this?
From the ...
1
vote
1
answer
666
views
Use the public key of a certificate as the key for HMAC SHA
Consider the following scenario. A company has several computers for each users on the same domain. They purchase an RSA certificate from a recognized authority which will be deployed with private / ...
1
vote
1
answer
115
views
Need a test vector for the putty ssh-2 file mac validation
I'm trying to implement the putty file format in one of my dart packages. Implementing the actual key loading was ok, but I'm struggeling with the mac validation. I'm not shure what I'm doing wrong ...
2
votes
1
answer
127
views
Using encryption key as input keying material
Libsodium supports Blake2 for key derivation. It seems like you shouldn't truncate the output to get two keys (eg one encryption/one mac) as the recommended way is to use a counter as the salt for ...
0
votes
0
answers
25
views
Does TLS provide data integrity? [duplicate]
I've looked around on this site and I've not seen a clear answer on this question.
From what I've read TLS does not provide data integrity unless specific ciphers are used which use HMAC'ing as part ...
1
vote
1
answer
286
views
Is md5(data + key) secure if a proper hmac function isn't available?
I need to generate a MAC signature for data on a website, but it's in a HTML templating system where there's only a few functions available. The only hashing function available is md5. Ideally, I'd ...
1
vote
0
answers
114
views
HMAC with random application Id and secret with DPAPI
We have open endpoints because there is a flow where access token is still not presented. Because of that, I've implemented HMAC + DPAPI (using Azure Blob Storage) to store the keys, without involving ...
2
votes
1
answer
4k
views
Which one to use AES : GCM vs CBC
I am planning to encrypt database fields using AES encryption.
Now, this encrypted data will not transfer over the internet and will reside in our own datacenter only.
From what I read, GCM mode ...
1
vote
2
answers
119
views
Terminology question - authentication through encryption
I came across a number of somewhat similar solutions, which are based on the knowledge factor related to a symmetric key in particular:
If a party was able to generate correct message authentication ...
3
votes
1
answer
617
views
Why HMAC/Signed API requests are not prevalent compared to API keys or JWT based requests
While all/majority of AWS APIs requests are signed with HMAC, it is not as prevalent for other APIs in general.
Most likely, the reason is because of the gotchas involved when client has to make the ...
0
votes
0
answers
106
views
What is the need of HMAC in Diffie-Hellman? [duplicate]
When Alice and Bob both have the same shared secret to encrypt their data (Diffie-Hellman) and Alice encrypts her data with this key and Bob can decrypt it with the same key, then Bob knows that the ...
0
votes
0
answers
810
views
cracking HMAC-SHA1 when the password and seed are inverted
I happen to have a few hashes generated with code that did this (it has been changed to use a more "standard" bcrypt call):
$ python3
>>> import hmac
>>> hmac.new(b'The ...
4
votes
1
answer
273
views
Can I HMAC my plaintext for use as a NACL SecretBox nonce?
I'm writing an application that needs to deterministically encrypt some data (where two equal ciphertexts will produce two equal plaintexts; this is acceptable and in fact desirable for this ...
0
votes
0
answers
418
views
Is it safe to use HMAC to create an API key?
I am planning to create an API key using the user's password as message and a random number assigned to that user in my database as key (or vice-versa). I will then store the hash of that API key in ...
1
vote
0
answers
87
views
Signing event-stream responses
I am working on an application where the general approach is signing most response payloads with HMAC, but there are a couple of endpoints that return text/event-stream in the response. What is the ...
0
votes
1
answer
2k
views
Is HMAC-SHA256 more secure to hide information than SHA256?
I need to save user email on a public database but I don't want to do it in plaintext, so I need to hash it. If somebody wants to verify if some email exists in the public database, he or she can ...
-1
votes
1
answer
116
views
How authenticate a login with javascript
I want to authenticate a user using a username and password in a web app running javascript interfacing to a non node js or php server. In a normal desktop app I could use bcrypt or an hmac or ??. ...
0
votes
1
answer
260
views
Is HMAC really a benefit for AES-CBC?
I think I quite well understand the theoretical benefit of adding the HMAC (authenticity/integrity on top of confidentiality), but I am looking at this from a key management point-of-view.
Premise: ...
2
votes
1
answer
162
views
How does Algolia's virtual API keys work?
Algolia allows you to generate virtual/secured API keys from another parent API key but without a call to their servers.
A virtual key thus generated on the server side with a defined "scope" (like ...
0
votes
1
answer
119
views
What advantage does HMAC provide in generating short hashes comparing to regular hash function?
This question is specific to the Apple/Google Contact Tracing framework. See https://www.blog.google/documents/56/Contact_Tracing_-_Cryptography_Specification.pdf for the cryptography spec.
In this ...
0
votes
1
answer
852
views
How to use Yubikey 5 NFC for online accounts, Linux login, and KeePassXC?
I just got my Yubikey 5 NFC, and would like to use it for
Linux desktop login
Linux KeePassXC (which only supports hmac-sha1 challenge-response)
online accounts
When reading about U2F it seams to be ...
1
vote
2
answers
295
views
Can I use PBKDF2 derivation function to generate a MAC in PKCS12 file?
It seems that the default password based key derivation function that is used by PKCS12 to generate a MAC is this one. It is unique to the standard and probably not used anywhere else. Is it possible ...