Questions tagged [hmac]

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

Filter by
Sorted by
Tagged with
5
votes
1answer
2k views

SSO via HMAC and shared key. Can this be improved?

Given an authenticated user on A.com, we want to redirect the user to B.com so that she'll be immedaitely authenticated. The scheme I'm considering is very basic: A.com and B.com both share key S. ...
5
votes
1answer
5k views

How to perform in-browser signing of data with Javascript using HMAC-SHA512?

My client-side JavaScript program needs to make HTTP posts to a service that requires POST data to be signed by my private "secret" according to the HMAC-SHA512 method. I have the "secret", but I ...
5
votes
3answers
6k views

HMAC What is secure manner to distribute shared secret between client and server?

I am looking at ways to secure http communication using HMAC. My understanding is that in this scenario the client and the server both know a secret. This means the secret must be first generated on ...
5
votes
1answer
4k 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 ...
5
votes
1answer
2k views

Does using the same secret key for AES-256-CBC and HMAC-SHA512 in Encrypt-then-MAC potentially compromise the key?

Suppose I use a key (and IV) to encrypt a piece of binary data with AES-256-CBC to produce the corresponding encrypted data. Suppose I then throw this encrypted data into HMAC-SHA512 using the same ...
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 ...
5
votes
1answer
429 views

Authentication by Signing or MAC?

I'm still new to security, so I'm sorry if this question doesn't make sense or if I'm completely off base with something. I've got some messages I want to encrypt (probably with AES-256-CBC) and send ...
5
votes
2answers
421 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 ...
5
votes
1answer
764 views

HMAC password reset link and replay attacks

I like the look of this technique for sending password reset links: https://neosmart.net/blog/2015/using-hmac-signatures-to-avoid-database-writes/ (TLDR: don't store token in database. Send password ...
5
votes
1answer
259 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 ...
5
votes
3answers
279 views

Why can't a cryptographic hash inside a cryptogram serve as a MAC? [duplicate]

My question is closely related to Why do you need message authentication in addition to encryption? Specifically I am interested in symmetric-key cryptography. I understand that attackers may modify ...
5
votes
1answer
3k views

HMAC secret key client storage

I've read numerous articles about using HMAC and the secret key for client authentication in a RESTful client (Javascript) application today. Still, I don't find a single source that is able to ...
5
votes
1answer
1k views

cracking krb5 passwords (des3-hmac-sha1 and des-cbc-crc ) [closed]

I'm trying to audit kerberos passwords. The available formats are des3-hmac-sha1 and des-cbc-crc but I cannot find a possibility/a tool to crack them. For other hash-types I used John the Ripper, but ...
5
votes
3answers
11k 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 ...
4
votes
3answers
464 views

What SSL options should not be used?

What SSL options should be avoided, due to recently discovered weaknesses? This might include symmetric algorithms, or MAC functions.
4
votes
3answers
298 views

How to simply and efficiently generate different keys from one password?

I saw here that using the same key to encrypt and mac (in that order) a message could eventually be unsafe. What is the best way to generate two different keys from the same password (using a PBKDF ...
4
votes
3answers
1k views

How do I transfer the HMAC?

I have a file I'd like to encrypt with a symmetric key using AES-256 and then use an HMAC for integrity. So I don't "roll my own" scheme which I know is a big mistake, what are the standards for using ...
4
votes
1answer
965 views

Can a salted hash be an effective MAC?

An HMAC is basically a "keyed hash". Only the correct message and the correct key will produce a particular hash digest efficiently. Conceptually speaking, the same can be said for a salted hash; ...
4
votes
1answer
498 views

Random number for HTTPS Message Authentication Code (MAC)

Recently I found that Netscape used quite simple algorithm to generate random number for Message Authentication Code to establish an HTTPS connection (Netscape used time, process identification number,...
4
votes
1answer
3k views

Web service HMAC authentication/anti-replay

I am creating a web service, which handles various requests from web clients. The client and server share a big secret key S, and when one part wants to send data, it calculates the token as follows: ...
4
votes
2answers
1k views

Reusing HMAC state for multiple messages

I have a secret key k and message m. I send m || HMAC(m, k) to some other party, who can verify the integrity of m, assuming that they know k. Suppose I have multiple messages m1, m2, and so on. ...
4
votes
3answers
306 views

Question regarding MAC and encryption

I was reading the chosen answer to the following question - "MAC vs Encryption" They say that just using encryption, "an attacker could alter the ciphertext to make it say something else when ...
4
votes
2answers
2k views

Online banking proof of transaction for vertification in court

So, when i do an online payment transaction i "sign" my transaction with my digipass using some sort of a MAC (HMAC) with a shared key and some information that is unique for this transaction. But ...
4
votes
1answer
495 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 ...
4
votes
1answer
2k views

SSL/TLS CipherSuite TLS_NULL_WITH_NULL_NULL

CipherSuite TLS_NULL_WITH_NULL_NULL means no encryption no mac Then why it is standardized?What for? And popular browser and Server support it?
4
votes
1answer
8k 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. ...
4
votes
1answer
4k views

How and when is a MAC sent across during a TLS connection?

I have been trying to get my head around the MAC part of the TLS connection as both the key exchange and cipher seem to make sense. As far as I understand the MAC is used to ensure that the ...
4
votes
1answer
3k views

Request signing for REST API

I am building a REST API that will receive requests like: GET /api/entities GET /api/entities?filter=X&sort=Y This seems straight forward: have the client HMAC(path + query, key), send me a key ...
4
votes
1answer
491 views

Encryption and HMAC with the same password

I need to send authenticated ciphered messages by using a single password. Reusing the same (derived) key for the block cipher and the HMAC is not a good practice, I know. My initial idea is to ...
4
votes
1answer
907 views

Writing your own John the Ripper module

I have a script in C, which is able to determine the password of certain data. It uses HMAC and RC4 algorithms to encrypt the given password and then compares that later to the given data. If they ...
4
votes
1answer
973 views

What's the weakness of keyed-MD5 for message authentication?

I've seen public web API's using keyed-MD5 to generate message authentication code rather than adopting the HMAC algorithm. People wouldn't just invent HMAC for fun, so it must have some advantages ...
4
votes
1answer
3k views

Authentication and security of a REST API

Scenario: I design a REST API where authenticated users can hit the API over TLS. I have to use TLS as the data transmitted over the wire is sensitive. I don't need authorization right now, but I don'...
4
votes
1answer
2k views

How secure is HMAC

I'm a building a RESTful stateless API and I'm using a token for authentication. The problem I'm having is I'm not sure how secure HMAC is. I'm using a JSON Web Token library that let's me encrypt and ...
4
votes
1answer
4k views

Openssl ciphers SHA384 and AEAD

When running the command: openssl ciphers -v I get a long list of cipher combinations. I'm having issues interpreting some of them. An example is: DHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=DH Au=RSA ...
4
votes
1answer
3k views

What key to use in HMAC

I need to use HMAC on a certain message to guarantee integrity, but I cannot figure out what are the requirements for the key to be given as input to the hashing algorithm. In particular I have to ...
4
votes
1answer
457 views

How do I build a secure signing mechanism on top of HMAC

Say we have a system with strong shared keys (not passphrases), and we're trying to sign messages sent by the server that will be visible to an attacker. E.g. storing session state in a signed cookie. ...
4
votes
1answer
170 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 ...
4
votes
1answer
1k 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 ...
4
votes
1answer
825 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 ...
4
votes
1answer
222 views

Generating secret keys with secret keys

Hydra is a secretive organization. It is comprised of several Directors at the top, and many Agents underneath them. A Director sends Agents on secret missions. During these missions, communication ...
4
votes
1answer
310 views

Is there a tree hash form of MAC that can be used when encrypting data for storage on S3 using multipart upload?

I am storing files on S3, some of which are very large, and need to be stored encrypted. I had planned on using Galois Counter Mode since it includes the MAC, however this won't work with multipart ...
4
votes
0answers
134 views

how to create TPM_AUTHDATA as input in tpm commands ?

I'm writing my first program which use tpm (version 1.2) services in Windows 7 using TBS, in this program I'm trying to execute the TPM_CreateWrapKey command. I noticed that many commands like the ...
3
votes
2answers
12k 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 ...
3
votes
2answers
2k views

FIPS Compliance with HMACSHA1 vs HMACSHA256 / HMACSHA512

My organization has a group policy that is applied to servers enforcing FIPS compliance (Windows AD policy). In .NET, HMACSHA1 is one of the encryption/hash algorithms that is FIPS compliant. I don't ...
3
votes
2answers
3k views

Client certificate vs HMAC

My team is working on web API project for one customer which will call this API. Now we are thinking about authentication. We've stopped on two options HMAC and client certificates HMAC: pros - no ...
3
votes
6answers
851 views

Is it safe to use HMAC with a public key for the purpose of salting?

I would like to store password hashes in a database. In order to prevent dictionary attacks, I was thinking to use HMAC with a key parameter which is public - like user id. That means the user id ...
3
votes
1answer
743 views

HMAC and integrity

I'm studying network security and I found this question in my slide, but don't have an answer. Discuss the use of keyed HMACs for guaranteeing the integrity of a file being transmitted over the ...
3
votes
2answers
329 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 ...
3
votes
4answers
4k views

Authentication with client certificate vs HMAC

I'm designing an API intended for use by a very limited number of trusted clients, likely a server cluster. The API can be accessed only through HTTPS. To authenticate the clients, I'm considering 3 ...
3
votes
1answer
974 views

What extra protection is added to an REST API over HTTPS by the use of some kind of HMAC?

I'm designing a RESTFUL API that will always be used over HTTPS, what security advantages over the use of HTTP Basic Auth could be brought to my system by using such kind of message authentication ...