(HMAC)-based key derivation function (HKDF), which can be used as a building block in various protocols and applications. The key derivation function (KDF) is intended to support a wide range of applications and requirements, and is conservative in its use of cryptographic hash functions.
Questions tagged [hkdf]
15 questions
8
votes
1 answer
Is HKDF implemented in Java Cryptography Architecture?
In the application I'm writing I need to do HKDF to derive two different keys from one password. Searching for examples on how to it in Java I found these…

Pablo Fernandez
- 279,434
- 135
- 377
- 622
3
votes
2 answers
zero knowledge architecture
I would like to encrypt some user data with the zero-knowledge architecture. I reference the implementation of the bitwarden and don't understand some parts.
First, I would like to use the the argon2 to derive the key instead of pbkdf2, since it…

Daniel Chan
- 343
- 5
- 13
3
votes
1 answer
How to use HKDF with ECDiffieHellmanCng
I am attempting to use the ECDiffieHellmanCng class to perform key exchange operations between a desktop and a device connected over BLE. The specs of the system require that HKDF be used to derive the key. That doesn't appear to be an option for…

Sam
- 1,325
- 1
- 13
- 26
2
votes
1 answer
What is the purpose of using HKDF?
I saw a code snippet that generates an AES key by the following steps:
Generate a 16-byte random value array.
SecureRandom random = new SecureRandom();
byte[] key = new byte[16];
random.nextBytes(key);
apply the HKDF to the key to generate a new…

Ya Xiao
- 861
- 8
- 16
2
votes
1 answer
Javacard key derivation (hmac) using javacardx.security.derivation
i am trying to figure out how the javacard derivation functions work, and i must admit i am lost as to how to set up the functions.
I figured that the DerivationFunction can be used to derive key, and using ALG_KDF_HKDF i could specify the desired…

Zerg Overmind
- 955
- 2
- 14
- 28
2
votes
0 answers
HKDF Android implementation
I'm trying to implement key exchange with HKDF for key derivation. I already looked at Is HKDF implemented in Java Cryptography Architecture?
Ask Question
, however, I'm still not getting what I am supposed to get.
In python, I have the following…

Bram
- 2,718
- 1
- 22
- 43
1
vote
0 answers
EVP_PKEY_CTX_new_id returns NULL openssl 1.1.1g
I am using openssl 1.1.1g to implement parts of the quic RFC.
I followed the suggestions in the following link
How to use OpenSSL 1.1.1 to implement HDF-Extract?
But the very first call (EVP_PKEY_CTX_new_id) fails with…

user16959423
- 11
- 2
1
vote
0 answers
Implementing the Double Ratchet algorithm
I'm trying to implement from scratch the Double Ratchet algorithm using this as my guide, however I am not an expert of crypto stuff, thus some things are quite unclear:
The guide refers to a "root key" RK, and an output of a DH as parameters to…

docdev
- 943
- 1
- 7
- 17
1
vote
2 answers
AES Key Generation using HSM and HKDF
We have safenet HSM. Our system requires us to generate AES-256 keys. Which approach shall I take ?
Instruct HSM to generate AES keys.
Use HSM to create an input key material and use HKDF to derive keys.
HSM is supposed to be able to generate high…

XpressDev
- 11
- 3
0
votes
1 answer
HKDFExpand in NodeJS
I try to implement HKDFExpand in NodeJS using crypto library
The goal is to decrypt encrypted bitwarden (password manager) password protected export in NodeJS.
I try to mimic the same behavior in NodeJS
but the expanded key is different from the…

anonymous
- 19
- 1
- 3
0
votes
1 answer
How to derive keys (HKDF) from two EC key pairs in Dart/Flutter?
I'm currently implementing ISO 18013-5 (mobile driving license) using Dart and Flutter (sorry, can't share the full specification document). Briefly, in order to prevent eavesdropping during a data exchange between a reader (e.g. Police) and a…

Bishop19
- 37
- 9
0
votes
1 answer
How to do a triple Diffie-Hellman(3 - DH) key agreement in Java using bouncy castle?
There are ample examples on how to do Diffie-Hellman key agreement to compute a shared secret. However, I could not find any example on how to do 3DH in java using bouncy castle(or any security provided to be honest). All of what I am finding,…

Uma Priyadarsi
- 85
- 1
- 3
- 11
0
votes
1 answer
Compute ecies hkdf symetric key with pycryptodome
Context: i'm working on making a python version of paymentmethodtoken from the google tink library to work with gpay messages. For that i use only python and PyCryptodome.
With that said i'm currently trying to implement an equivalent of the kem…

Bastien B
- 1,018
- 8
- 25
0
votes
1 answer
Openssl ‘EVP_KDF’ was not declared
In openssl, I want to run the following code sample that I got from the HKDF extraction documentation:
#include
#include
#include
...
EVP_KDF *kdf;
EVP_KDF_CTX *kctx;
unsigned char…

quasimodo
- 45
- 4
0
votes
1 answer
How to use OpenSSL 1.1.1 to implement HDF-Extract?
I'm trying to implement parts of the QUIC RFC and they note:
initial_salt = 0xc3eef712c72ebb5a11a7d2432bb46365bef9f502
initial_secret = HKDF-Extract(initial_salt,
client_dst_connection_id)
I was just…

ExBigBoss
- 43
- 6