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.
641
questions
0
votes
2
answers
88
views
Derive Multiple Keys from password
I am currently building a platform for storing documents for my private use. The goal is to upload only encrypted files.
Therefore i want to use the user password for authentication and also for ...
0
votes
0
answers
32
views
Finding wifi encryption key in memory
I wanted to know whether the encryption keys derived for data encryption are stored in RAM or not after establishing a Wi-Fi connection in WPA2 and WPA3 protocols. If the answer is yes, can these keys ...
5
votes
0
answers
158
views
"One use, one key" rule
Sometime in the late 1980's I was introduced to the "One use, one key" rule ("une clé par usage"). A longer version could be: a cryptographic key should have a single purpose, with ...
3
votes
1
answer
200
views
Why does using keyed-$PRF$-derived inputs in a (non-committing) $\texttt{nc-AEAD}$ not provide commitment?
A definition for committing security in authenticated encryption can be described in relation to a security parameter $\lambda_{com}$, where the per-guess probability of finding distinct input tuples
$...
1
vote
1
answer
65
views
Does a hierarchical key derivation exist? where child keys can decrypt values encrypted by descendants but not vice versa?
I'm trying to entertain a topic, I tried looking around, but I would like a a pointer or someone telling me simply "this cannot work".
I know that usual decryption by private key (whatever ...
2
votes
1
answer
103
views
Does the actual length of a password or salt provide any additional entropy to that contained within them?
I refer to the following wiki description of the Argon2 key derivation function:-
...
3
votes
1
answer
137
views
Is using KDF more insecure that generating key directly? (AES 256 CBC)
I am writing a PHP application that requires files to encrypted using AES-256-CBC.
I have two options:
Option #1
Generate a totally random AES key => User Key
Generate another totally random AES ...
0
votes
0
answers
86
views
Key recovery attack on BIP32-Ed25519
BIP32 describes a method for deriving secp256k1 key-pairs. BIP32-Ed25519 is a similar method for Ed25519. For both, the derivations proceed from a root key-pair by adding a random-like integer to the ...
1
vote
0
answers
163
views
Curve448 ECC parameters for use with OpenSSL
I need to be able to deterministically generate (and re-generate) private-public ECC key pairs curve448 for ECDH from human-friendly passphrases (not necessarily human-memorable, just easy to type in),...
0
votes
1
answer
122
views
Deriving the RSA private key [duplicate]
Is there any way to derive the RSA private key from another RSA private key?
Let's say I have a base RSA key $(P, Q)$ (both prime), and then use some salt and an algorithm that creates a new primes, e....
1
vote
0
answers
69
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
1
answer
125
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 ...
4
votes
1
answer
155
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
200
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 ...
1
vote
1
answer
68
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
227
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
578
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
212
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
112
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 ...
0
votes
1
answer
128
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
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
603
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.
...
5
votes
1
answer
214
views
Robust CMAC-based key derivation function
I need to select a function that will be used as a key derivation function (KDF) and pseudorandom function (PRF) in contexts that I haven't anticipated. It will run on very low-end devices (think ...
2
votes
0
answers
128
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
26
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?
...
1
vote
0
answers
88
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
530
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 ...
0
votes
1
answer
115
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
84
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
193
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
62
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 ...
6
votes
1
answer
385
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 ...
0
votes
1
answer
270
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
0
answers
40
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
143
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
60
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(...
2
votes
1
answer
181
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
348
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
2k
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
42
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
395
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
102
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 ...
0
votes
0
answers
780
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 ...
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
117
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 ...
2
votes
0
answers
75
views
Deriving multiple deterministic keys in a Schnorr Multisig setup
Let's say that Alice and Bob have generated truly random private keys $a$ and $b$ and want to use them in Schnorr signing. They calculate $X = g^a \cdot g^b$ as their mutual public key. For whatever ...
5
votes
1
answer
375
views
For password-based authenticated encryption is it OK to derive the auth key from the crypt key with 1 iteration?
That is, in the case where the iterations value is a large number, since iterations are costly is there a difference in security of doing something like this, where two separate derivations are ...
2
votes
2
answers
486
views
Can you restore a private key from biometrics?
My understanding is that iOS FaceID/Fingerprint for example use an underlying mathematical representation of the biometric features.
Is it possible to generate a key pair from this representation and ...
4
votes
2
answers
831
views
Deriving private keys from a signature/HSM
I have access to an HSM that can sign messages but doesn't have a way to expose the private key. The signatures are deterministic (RFC 6979). Another application only works with ed25519 signatures ...
4
votes
2
answers
603
views
Does combining multiple PBKDF2 keys result higher iteration count when using same password but different salts?
I did some experimenting with web subtle crypto.
I derived a key using PBKDF2 with SHA-512 and 100 000 iterations and timed it.
Doing same with 200 000 rounds doubled the time as expected.
Then I did ...