Questions tagged [key-derivation]

In cryptography, a key derivation function (or KDF) derives one or more secret keys from a secret value such as a master key or other known information such as a password or passphrase using a pseudo-random function. Keyed cryptographic hash functions are popular examples of pseudo-random functions used for key derivation.

Filter by
Sorted by
Tagged with
24 votes
6 answers
47k views

PBKDF2 and salt

I want to ask some questions about the PBKDF2 function and generally about the password-based derivation functions. Actually we use the derivation function together with the salt to provide ...
1 vote
0 answers
37 views

How to correctly use .NET's HKDF key derivation APIs to generate two keys for AES-256-CBC HMAC-SHA256 encryption

I have a 32-byte cryptographic key generated using .NET's cryptographic random number generator, and I'd like to use it as the key material to generate two other keys per user in my web application. ...
2 votes
0 answers
81 views

Why does Argon2 truncate BLAKE2b outputs?

The Argon2 variable-length hash function uses BLAKE2b directly if the user requests an output less than or equal to 64 bytes in length. However, if the user requests an output longer than this, each ...
3 votes
1 answer
114 views

Does the length extension attack apply to KDFs?

Older hash functions like SHA-256 and SHA-512 are vulnerable to the length extension attack, which is problematic in the context of a MAC. There are several ways to prevent this: Use a newer hash ...
2 votes
1 answer
123 views

Loop back or cyclic nature of secp256k1 curve

I am working with point addition and scalar multiplication on the secp256k1 curve for points $(x,y)$ or public keys to derive the next public key scalar k times further from it. Actually when I use a ...
0 votes
1 answer
65 views

Is there an open source key-derivation service?

Hello sorry if this is a silly question and do say if this would be more suitable for a software stack-exchange but after a lot of googling I've still not found anything suitable, so starting to worry ...
0 votes
1 answer
846 views

AES Password Based Key Derivation Iterations

I have been writing my own implementation of the Advanced Encryption Standard with cipher block chaining in python3 for the last several months, mimicking the OpenSSL command line interface. I can ...
1 vote
1 answer
55 views

Using parts of the master seed as the salt for HKDF

Does using a portion of a master seed, such as the last 12 bytes of a 128-byte random master seed, as a salt provide any additional security to the HKDF when deriving child seeds? Alternatively, is it ...
1 vote
2 answers
126 views

SHA-512 for ECDH key derivation

I'm currently working in a constrained environment and need to derive a symmetric key (that will be used for AES-256 in GCM mode later) based on a low-entropy shared secret obtained via X25519. To ...
3 votes
2 answers
538 views

RSA perfect square phi

So I've been learning about RSA for quite a while (mainly by playing around in CTF competitions) and I came across an interesting problem. The other day I was looking to create a challenge in which I ...
1 vote
2 answers
163 views

What scheme is the best for combining two shared secrets?

I'm developing a program that uses a hybrid Key Encapsulation Mechanism (KEM) scheme, employing Kyber and X25519, with each producing a 32-byte shared secret. What would be the best scheme to combine ...
0 votes
0 answers
87 views

Is it safe to derive a secret from a signature?

Many blockchain users have wallets that hold a private key, which can interact with a website. For example, the website can request the wallet to sign a specific message. 'Do only sign this message if ...
4 votes
1 answer
111 views

Robust CMAC-based key derivation function

I need to select a key derivation function that will likely be used in contexts that I haven't anticipated. It will run on very low-end devices (think potato-powered IoT sensor with a bulk cost of a ...
0 votes
0 answers
46 views

Entropy output from 256-bit Argon2 input [duplicate]

I would like to deterministically derive two different 256-bit keys from a single passphrase -- one used as an ECDSA private key, the other as a symmetric key for AES-GCM. Would a KDF output ...
1 vote
1 answer
261 views

Key exchange for encrypted firmware update

I'm trying to implement encrypted firmware update functionality for an embedded device. The goal is to prevent reverse engineering of our firmware when the update files are shared with our customers. ...
4 votes
2 answers
252 views

How can a hash function be suitable for hashing passwords, but not for deriving encryption keys, and vice versa?

Not being a specialist in this field, I am nevertheless constantly trying to keep up with which methods are being considered secure for storing passwords and for encrypting data. During my research ...
1 vote
1 answer
145 views

Use of HKDF to get shorter key than digest size

Is OK to derive a key using HKDF (Extract & expand) with a shorter size than the digest size of the configured hash function? In that case the result is computed (on the expand part) by truncating ...
2 votes
0 answers
88 views

Why KeePassXC is deriving (stretching) the key again before saving changes to the database?

KeePassXC supports Argon2, which is great for security. However, there's a quirk that's been bothering me. Every time I save modifications to the database, it seems to stretch (derive) the key again, ...
1 vote
0 answers
24 views

Scheme to derive an encryption key from one's verification key, so they can reduce the decryption key from it and their signing key? [duplicate]

There is DH key exchange, but it requires an exchange before participants get to the shared secret. If Bob has only published a verifying key VB, is there a scheme where the following can be achieved? ...
5 votes
1 answer
1k views

Is it true that 7zip doesn't use any salt with its KDF?

This issue claims that 7zip does not use any salt with its key derivation function: https://github.com/magnumripper/JohnTheRipper/issues/1679 If that's true, wouldn't that mean you can crack multiple ...
6 votes
1 answer
268 views

Cache-hard or memory-hard password hashing algorithms?

bscrypt is a cache-hard password hashing algorithm/KDF from Steve Thomas (aka Sc00bz/TobTu), who was on the Password Hashing Competition (PHC) panel. He argues it is better than the alternative ...
1 vote
0 answers
79 views

Two-party randomness for KEM

As indicated in an earlier Q / A, KEM's do not necessarily directly encrypt a pre-generated random value. However, it is clear that some KEM's do actually do this, with RSA-KEM being an obvious ...
1 vote
2 answers
258 views

Why does ECIES use "Key Encapsulation"? Does it?

In yet another twist that is the terminology around key establishment I found out that ECIES is often denoted as key encapsulation followed by data encapsulation. I'm wondering how the term "key ...
5 votes
0 answers
763 views

For TCG-Opal drives, which password is used to derive KEK?

SEDs use a user password (PIN) to generate KEK by a KDF algorithm. The KEK is then used to encrypt the MEK (where MEK is internally generated in the drive). But TCG-Opal drives have 9 locking-ranges ...
0 votes
0 answers
106 views

Question regarding JWK generation using RSA-PSS 4096

Summarized Question: In the context of JWK generation using RSA-PSS 4096bit with SHA-256, where the public exponent is "e" = 65537, is there any situation ...
2 votes
2 answers
111 views

How do KDFs work, and what existing implementations exist?

TLDR/End goal I want to encrypt a tree of data/files so that anyone with the master key K can decrypt everything, key K-1 can ...
5 votes
2 answers
5k views

How to specify a NIST SP 800-108 KBKDF

Strange question maybe, but say I want to specify a protocol that complies with NIST SP 800-108. This lists a whole set of key based key derivation functions, with a very loose set of parameters. How ...
0 votes
1 answer
99 views

How much of SHA3's internal state can be reached?

After reading that about "37% of the 256-bit outputs" of SHA-256 are unreachable when fed only 256-bit inputs [1] I'm curious & confused. The formula from the proof here considers a ...
0 votes
1 answer
68 views

RFC: Approach to CSPRNG

I've been experimenting in python with different approaches to cryptographically secure pseudo random number generators, comparing them using the NIST testsuite implemented by https://github.com/...
0 votes
1 answer
113 views

Is keccak256 (and similar hash functions) a suitable KBKDF for 256-bit keys?

Let's temporarily work upon the assumption that proper KBKDF functions do not exist, for the sake of argument. Would keccak256 be a secure choice for a KBKDF that derives 256-bit keys from a 256-bit ...
1 vote
0 answers
56 views

Linux Kernel CryptoAPI key exchange and key derivation

I have a custom network and I want to implement a symmetric key exchange and key derivation mechanism with ECDH. I know that I need to use KPP API and ECDH helper functions, but I can't find any code ...
0 votes
0 answers
38 views

DES encryption Key from a passphrase

I have been given a DES encryption assignment. I was given the Cipher text, the Plain text and the "passphrase". The passphrase consist of a 4 byte hex string. I have studied several ...
0 votes
0 answers
123 views

PCI compliance - use of ANSI X9.17 for export keys

we have a concern about a key export. We completed the migration to Key Block LMK in our environment (with HSM Thales 10K). Now, we have to exchange keys with third-parties that still use Keys in ...
0 votes
1 answer
145 views

Clarification on the use of Key block Version ID with Thales HSM

Clarification on the use of Key block Version ID For the first time since we migrated to the Key Block we are exchanging keys with third parties, The keys were all generated by choosing Key Scheme &...
2 votes
2 answers
934 views

security of using digital signature as key derivation material

I want all keys in my iOS application to rely on the Secure Enclave for security as the iOS keychain becomes insecure on jailbroken devices. Currently, the Secure Enclave currently only supports ...
2 votes
0 answers
38 views

ZKP of knowledge of EC keys preimage

There is a random scalar seed $s$ which we may call a master secret. There are 2 public strings or scalars: $m1, m2$ and 2 corresponding EC keypairs: $a, A=a*G$ and $b, B=b*G$ $a$ and $b$ are somehow ...
2 votes
1 answer
137 views

Deterministic EC key derivation with anonymity and proofs

Following up this question There are 4 parties: Alice, who needs to prove a posession of some statement $m$, unique to her, say a street address, which is basically a string of some predefined format,...
3 votes
1 answer
54 views

It is correct to concatenate HKDF expand stages?

I want to derive session keys for many clients from a Master Key. Suppose I derive a key for the client $n$ in the following way: master_key = HKDF-extract(salt, IKM) key_client_n = HKDF-expand(...
4 votes
2 answers
780 views

Bluetooth Low Energy: Key generation

I'm studying the BT core spec v5.1 to understand the security features and how everything fits together. I am looking at Secure Connections for now. In the field "Key generation" it says it uses P-...
1 vote
1 answer
114 views

Manually deriving asymmetric key pairs with Openssl

In Openssl, is there a way to systematically generate a private key such that every time you perform this key derivation, you produce the same private key? It seems like every openssl command that ...
3 votes
1 answer
330 views

Is the output of HKDF uniformly distributed, if my input is not?

I have done some research on HKDF but I am still not sure about the security properties in different scenarios. Which properties are fullfilled, when IKM and the salt are random and secret, but not ...
1 vote
1 answer
1k views

How do non-"resident" keys work in WebAuthn?

If we look at the WebAuthn specification, then, during the "registration" ceremony, the authenticator generates a new key-pair and a unique user-id. Then the public-key and the unique user-...
4 votes
0 answers
40 views

What is the impact of leaving a salt used in HKDF open to attacker control? [duplicate]

RFC 5869 for HKDF says "an application needs to make sure that salt values are not chosen or manipulated by an attacker".1 Soatok also discusses some nuances in choosing salts for HKDF.2 ...
2 votes
1 answer
330 views

Deriving secret keys vs generating and encrypting them

Suppose one has a password manager, based on symmetric cryptography, that requires a master passphrase to be unlocked. Argon2 is used for deriving a secret key from the master passphrase. I need ...
1 vote
1 answer
84 views

Can HKDF be used in place of a cryptographic hash function?

For context, I'm making a non-production grade reference implementation of the balloon hash function using the Web Crypto API. In order to make it less susceptible to certain attacks on common memory ...
4 votes
2 answers
844 views

Revoke a GPG key using previously generated revoke certificate after renewd (change expiration date)

I have few sub-questions Do secret keys get expired, or just the public key gets expired? Do I have to back up the master sec key each time I renew it? For an ...
0 votes
0 answers
475 views

Cracking 2-Key Triple DES

I've been given that an attacker has a 2-Key Triple DES Cracker that is capable of performing 10$^{24}$ encryptions per second and have subsequently been asked how long it must take before the ...
3 votes
2 answers
487 views

Is a simple KMAC-128 or KMAC-256 hash secure as a KDF?

Context I am trying to build a simple protocol for key derivation. I want to use SHA-3 family hash functions, which (as far as I understand) should not be combined with HMAC because their security ...
29 votes
4 answers
7k views

Is there a hash function that's more expensive for an attacker than for the server?

Say a server wants to hash a password $p$. It would use a secure hash function $H$ and a unique salt $s$ to hash the password as $H(p,s)$. If one has access to the salt, each password candidate ...
1 vote
1 answer
88 views

Understanding symmetric encryption security in relation to password-based key derivation

Here are some assumptions on which the question is based. If anything is wrong with this, please point this out straight away: Let's say I have a file I want to encrypt with AES256 symmetric ...

1
2 3 4 5
13