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
1 answer
50 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 ...
user avatar
  • 103
0 votes
1 answer
37 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 ...
user avatar
  • 3
1 vote
0 answers
49 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 ...
user avatar
1 vote
0 answers
105 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 ...
user avatar
  • 99
0 votes
1 answer
24 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 ...
user avatar
  • 101
0 votes
0 answers
65 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 ...
user avatar
0 votes
1 answer
90 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 ...
user avatar
0 votes
2 answers
59 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. ...
user avatar
  • 101
2 votes
2 answers
169 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 ...
user avatar
  • 23
0 votes
0 answers
48 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 ...
user avatar
  • 101
0 votes
1 answer
58 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 (...
user avatar
  • 25
2 votes
2 answers
85 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 ...
user avatar
0 votes
1 answer
149 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 ...
user avatar
1 vote
0 answers
121 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 ...
user avatar
  • 162
0 votes
2 answers
145 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 ...
user avatar
  • 627
0 votes
2 answers
149 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 ...
user avatar
  • 103
0 votes
1 answer
137 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 ...
user avatar
  • 147
1 vote
3 answers
481 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 ...
user avatar
  • 113
0 votes
2 answers
113 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 ...
user avatar
0 votes
0 answers
153 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, ...
user avatar
0 votes
1 answer
510 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 ...
user avatar
1 vote
0 answers
565 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 ...
user avatar
1 vote
1 answer
305 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 / ...
user avatar
0 votes
1 answer
80 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 ...
user avatar
2 votes
1 answer
99 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 ...
user avatar
  • 21
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 ...
user avatar
1 vote
1 answer
188 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 ...
user avatar
1 vote
0 answers
78 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 ...
user avatar
2 votes
1 answer
2k 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 ...
user avatar
1 vote
2 answers
113 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 ...
user avatar
1 vote
1 answer
156 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 ...
user avatar
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 ...
user avatar
0 votes
0 answers
489 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 ...
user avatar
  • 125
4 votes
1 answer
218 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 ...
user avatar
0 votes
0 answers
313 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 ...
user avatar
1 vote
0 answers
84 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 ...
user avatar
0 votes
1 answer
956 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 ...
user avatar
-1 votes
1 answer
95 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 ??. ...
user avatar
0 votes
1 answer
148 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: ...
user avatar
2 votes
1 answer
139 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 ...
user avatar
0 votes
1 answer
106 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 ...
user avatar
  • 101
0 votes
1 answer
677 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 ...
user avatar
1 vote
2 answers
193 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 ...
user avatar
  • 195
3 votes
2 answers
2k views

How do backup codes work in TOTP, like Google Authenticator?

My understanding is that in TOTPs are like HMAC where code is derived from time. However, I am struggling to understand the concept of Backup Codes in Google Authenticator, and how are they ...
user avatar
1 vote
1 answer
305 views

Are short messages hashed with a HMAC insecure?

Imagine I were to provide a person with a single letter "A" and the HMAC-SHA256 hash of this message, keyed with my secret key. Would this person be able to derive any information about my secret key?...
user avatar
0 votes
1 answer
185 views

Is it secure to use HMAC to pass a string to be verified?

I am working on a Django project and trying to create a REST API to verify email without using any database. My present server connection is HTTP and not HTTPS. So someone using the API end point ...
user avatar
  • 101
0 votes
0 answers
94 views

Does transmitting short, predictable plaintext along with the HMAC signature of that text present a security risk

In order to allow clients to verify responses originating from our server, we are generating an HMAC signature of the body and a timestamp, and attaching it as a header. The timestamp is also attached ...
user avatar
  • 185
1 vote
2 answers
263 views

I am signing (HMAC) outgoing webhooks to allow users to verify their source, should I also sign outgoing responses?

To allow api users to verify the authenticity of outgoing webhooks, I am using a similar model to slack: Concatenate timestamp and body, HMAC with pre-shared key, add timestamp and HMAC digest to ...
user avatar
  • 185
0 votes
0 answers
99 views

Is this symmetric key system secure?

I am creating a secure network data transfer system, and would like to know if there are any obvious flaws in this scheme. Secrets The secret is a password that is known to both clients. This ...
user avatar
  • 197
2 votes
0 answers
135 views

concatenation vs multiple rounds of HMAC

I was studying the AWS request signature process and found that they derive the signing key from multiple sources (one and two related questions). Specifically this: kSecret = Your AWS Secret Access ...
user avatar

1
2 3 4 5 6