Questions tagged [pbkdf-2]

The Password-Based Key Derivation Function 2 (PBKDF2) is a method of securely deriving encryption keys from a passphrase entered by a user. It features an iteration count that can be deliberately adjusted (key stretching) to slow down brute force password guessing attacks.

Filter by
Sorted by
Tagged with
0
votes
0answers
33 views

Can you derive a 128 bit AES encryption key using PBKDF2 with SHA-256

I got confused about key derivation functions. For my project, I need to derive a 128 bits AES encryption key in CTR mode. To do so, I'm using a PBKDF2 to derive this encryption key using an initial ...
2
votes
3answers
57 views

“Work factor” and “iteration count” nomenclature in adaptive functions

In adaptive functions like PBKDF2 / bcrypt I often read people refer to "iteration count" and others refer to "work factor", and they seem to be used interchangeably (even though they're not - the ...
0
votes
2answers
225 views

How to validate a PBKDF2 password

I want to encrypt several files correctly with a PBKDF2 generated key (using a password and salt), I am currently doing so but if I enter the wrong password, as expected an exception occurs. Note: ...
1
vote
1answer
40 views

One way hash of data records (PBKDF2?)

I'm looking for a way of one way hash data for multiple records. We have a privacy requirement to anonymise information "after it's used for its intended purpose" which is a little wooly at best. I'd ...
4
votes
1answer
189 views

Why derive keys from a master key instead of generating random keys?

I noticed AWS KMS generates encryption keys based off of a master key, using a key derivation function (HKDF). What's the practical advantage of deriving keys based on a master key? Isn't it simpler ...
2
votes
1answer
117 views

Using a KDF (PBKDF2) properly

I am new to crypto. I have a password for my user, e.g. &&38:while:HAVE:havana:60&& I want to encrypt several documents with 10 pages each with AES....
2
votes
1answer
369 views

Is it safe to split the output of PBKDF2?

I would like to know if splitting a key generated by PBKDF2 to derive two keys is a safe practice. Concretely, in my system, I need to derive two keys. One for symmetric cipher used in the client ...
2
votes
3answers
136 views

Deriving a key from a pseudo-random string

I would like to know if deriving a key from a pseudo-random string with a single iteration is secure. Concretely, I am designing a system where a secret key is derived in the client side, and then ...
1
vote
1answer
107 views

How to make my hash more robust to the brute force?

I'm using PBKDF2 SHA 256 with 100 000 iterations to generate a secret. I want to increase the cost of brute forcing the passphrase I use to generate the secret. I'm thinking of using scrypt after ...
3
votes
1answer
127 views

What is the most secure way to check that a given masterkey is valid?

For the purposes of learning, I'm writing a small utility that allows encrypting a list of passwords using a single master key (using AES-256 and PBKDF2) Before encrypting or decrypting any password ...
-1
votes
1answer
71 views

How many bits should I request from PBKDF2 to create a strong password?

I'm building a tool which generates passwords by hashing a service name with a master key. PBKDF2 was primarily chosen due to availability in the Web Crypto API. What would be a secure value for the ...
3
votes
2answers
268 views

KDF Salt: How/When is it Okay for it to be public?

Post Structure: Prior source material studied Question & Details Assumed threat model Example Assumptions Clarifications Prior source material studied 0.1. RFC 2898 0.2. HAC (Handbook of ...
2
votes
2answers
70 views

Can one trade off the number of iterations for key length with the PBKDF2?

When using the PBKDF2, is one taking on significant risk if one chooses to lower the number of iterations and choose to have very long keys? Can I XOR my message with a a very long key (plain-text ...
2
votes
1answer
107 views

Does it matter if I append the secret to the salt or pass it in separately?

I'm using PBKDF2, and this is my current call. key = pbkdf2-hmac-sha256(iterations = 100_000, secret = password ++ salt) I recently learnt that the function I'm ...
1
vote
1answer
74 views

Does having an SHA256 hash compromise PBKDF2 secrecy?

If I have a password pwd, and I hash it with SHA256 and send it to a server for authentication (server will apply ...
1
vote
2answers
718 views

Should number of iterations of PBKDF2 stay secret?

Let's say I encrypt my passwords with PBKDF2 and store it somewhere. Now let's say it was stolen and the hacker, who stole it knows it was hashed with PBKDF2. Does a knowledge of number of iterations ...
0
votes
2answers
97 views

Client-side password stretching - danger of the salt being public?

In case of using client-side password stretching (plus a single hash on the server) - the server would need to send the salt before authentication, of course. Though the salt is not considered a real ...
3
votes
2answers
141 views

Are PBKDF2 derived keys related if only the number of iterations is changed?

I'd like to encrypt my disk with a password. To generate a nice key from a password, I used PBKDF2, which applies a hash function $k$ times to a cleartext and outputs the final result. When I ...
2
votes
2answers
121 views

Does PBKDF2 reveal any knowledge about the salt?

DK = PBKDF2(PRF, Password, Salt, c, dkLen) When PBKDF2 is used for key derivation (not password hashing), is it possible for an adversary who doesn't know ...
3
votes
2answers
470 views

The logic of preferring PBKDF2 over iterative SHA2

I have studied PBKDF2 for the application of hashing passwords, and frankly I don't understand the justification for the complexity of PBKDF2 over iterative hashing with a cryptographic hash function. ...
0
votes
1answer
2k views

Create key for AES-256 in Node.JS [closed]

I'm trying to create a strong key for encrypting some data using AES-256 for fun and practice. For my own practice, I want to make this as strong as possible, I don't care how long it takes to ...
2
votes
1answer
301 views

Is transporting a salt, IV, ciphertext and HMAC in an encrypted token an acceptable practice?

I’m porting over some crypto code from Mcrypt (deprecated) to OpenSSL. I’m following a process that a former employee implemented, which is as follows: Create a random salt for use in a PBKDF2 key ...
5
votes
1answer
399 views

Is it problematic to use PBKDF2-HMAC-SHA256 to derive a 512-bit XTS key?

PBKDF2 should only be used to generate a larger output than the hash function it uses if the output is used in such a way that it has a flat keyspace. As far as I am aware, XTS does not have a flat ...
1
vote
1answer
297 views

Storing Salt in Ciphertext?

I found the cryptomator encryption documentation online, because I was looking for something to learn about x). I altered the process a bit to fit "my need" / so that I would not have a vault, but a ...
2
votes
2answers
117 views

Mechanism of PBKDF in encryption key generation with passphrase

I want to roughly understand how the mechanism works of generating an encryption key from a passphrase, by which we encrypt a volume or file. I'm familiar with public key encryption, the concept of a ...
2
votes
2answers
161 views

Multithreading PBKDF2 or javascript alternative

I'm using PBKDF2 in browser (can't use bcrypt, users are likely to have passwords > 72bytes, or whatever the number was). PBKDF2 is running in a webworker, something like so ...
-1
votes
2answers
152 views

Is HMAC a suitable substitute for HKDF?

My PHP version does not include the hash_hkdf() function, and upgrading versions is not worth the trouble for my project (which is for personal pleasure, not for ...
0
votes
4answers
688 views

I think PBKDF2 may be better than Scrypt? Looking for someone to point out my logical error

People seem to mostly recommend scrypt these days, but I'm not sure if this should be the case? I'll structure this post by just making an argument for PBKDF2 over Scrypt and then you can reply ...
3
votes
4answers
257 views

How many bits of entropy are leaked for every derived password from a master?

Given a master password that has a lot of entropy (similar to Bitcoin HD wallet seed words, 130 bits of entropy or more) how many bits of entropy are lost per leaked generated password? Let's take an ...
3
votes
2answers
153 views

PBKDF2 with longer than native output length - Will hashing the result help?

I've seen it mentioned more than once that PBKDF2 should not be used to create a longer key than the native output (such as 160 bits when used with HMACSHA1). Since an attacker could test only the ...
2
votes
2answers
679 views

HMACSHA1 vs HMACSHA2 (for PBKDF2)

I need to choose an HMAC function for PBKDF2. I'm using .net so I don't have the option to use SHA3. At first glance, and according to this answer by Thomas Pornin it seems like SHA512 would be best....
0
votes
1answer
386 views

Web Crypto API - deriveKey vs. deriveBits? [closed]

I have some questions about deriveKey and deriveBits for web crypto API. I am confused about the state of these APIs. I do ...
2
votes
1answer
190 views

Does this PBKDF2-SHA1 payload hint at a cryptographic security issue?

Blockchain first 16 encrypted bytes, IV, and iter_count – all encoded in Base64: Yms6xqrzCfFsQadVZ5gQonMtnQAAAAAAAAAAAAAAAAAAAAAQJwAA69tYNg== Does it looks like “...
14
votes
2answers
2k views

Password hash that can be upgraded without plaintext password

Most password hashes have a cost parameter that indicates how long the algorithm should take. Is there an algorithm where you can increase that cost for a particular hash, without access to the ...
7
votes
1answer
414 views

Is it safe to store both the AES-related data and the PBKDF2-related data (except passwords) in one file?

Assume an "encrypted data package" file format which includes the following data PBKDF2 algorithm salt rounds keylen AES algorithm & mode IV ciphertext where the PBKDF2 salt and AES IV are ...
1
vote
2answers
349 views

Argon2id internal iterations vs multiple Argon2id calls ?

TLDR; Is there a security risk if rather than setting the iteration parameter to 12 (for example), we set it to 3 but call the function 4 times? I'm asking that for 2 reasons: Firstly, we use SRP ...
5
votes
1answer
4k views

Apple secure notes. How secure?

In terms of cryptography, how secure is Apple Secure Notes? Can one store sensitive information there? The relevant section of the Apple white paper is quoted below: The Notes app includes a Secure ...
4
votes
4answers
902 views

Rehashing PBKDF2 hashes - do iterations stack?

Let's suppose I have a bunch of PBKDF2 hashes in a database. For the sake of keeping this simple, let's say I've used 10 iterations. A few years later I decide to upgrade to 20 iterations. I want to ...
1
vote
2answers
146 views

KDF-based password manager

I want to make a password manager that from a single master password generates passwords for my services. For that I thought that HKDF suits my needs, as it is able to generate multiple keys from a ...
1
vote
1answer
610 views

HMAC vs PKDBF2 as the first step towards HKDF

I'm implementing an application that from a password has to derive two keys, one for authentication with the server, one for encryption. I'm using Java, with JCA and Bouncy Castle. So far, to ...
1
vote
1answer
137 views

How to generate two different keys out of a single password?

I'm designing a system in which a password is used both for logging in as well as for encrypting some payload. To encrypt a payload I derive a key from the password. Very straightforward so far. ...
4
votes
1answer
517 views

Some Questions about the Veracrypt hash functions

Veracrypt has always been my favourite encryption tool since it came out . But still there are some things about the tool I don't understand . Why is there the possibility to use sha256 or sha512 . ...
0
votes
1answer
2k views

Proper number of salt bytes for Rfc2898DeriveBytes/PBKDF2

I know that .NET's Rfc2898DeriveBytes requires at least 8 bytes of salt, but how many bytes are ideal? When a user is created, or changes their password, my server stores a new random salt for that ...
1
vote
1answer
788 views

What is meant by “KDF2” vs “PBKDF2”?

I see many references to KDF2 here, but all links are broken and Wikipedia does not have an entry for KDF2. Is KDF2 a specific standard for Key Derivation without a password? Ultimately, I am trying ...
2
votes
1answer
802 views

Can pbkdf2 be used with a fixed salt to give a deterministic slow hash?

I need a password hashing function that is deterministic. Correlation attacks are not a concern. The same password must produce the same hash. I just want to protect the password against dictionary ...
1
vote
1answer
99 views

Ensuring no unintended leaking before authentication

Assume my authentication system consists of querying an endpoint to get sign in parameters cost and salt, ...
1
vote
1answer
117 views

Do PBKDF2 keys generated at a lower iteration count leak information?

Assume the threat model here is that the server is not to be trusted and the client is trusted. A user registers for an account and the client chooses an iteration count of 50,000 to generate a 512 ...
0
votes
0answers
50 views

Authenticating PBKDF2 params from the server

In my app, I use PBKDF2 to stretch a user inputted password. I split the result in two: the first half is stored locally as an encryption key (and never sent to the server), and the second half is ...
1
vote
1answer
192 views

Generating HMAC-SHA256 - is this procedure secure enough?

I have 256-bit value (call it "{Secret Value}") and I would like to compute HMAC-SHA256 digest of this value to check its ...
1
vote
1answer
844 views

Must a key for a HMAC-SHA256 digest kept secure?

I need to check integrity of high secure system value - in this case encryption key(s) I would like to create HMAC digest of this user encryption key (key is used ...