Questions tagged [pbkdf2]

PBKDF2 (Password-Based Key Derivation Function 2) is a key derivation function that is part of RSA Laboratories' Public-Key Cryptography Standards (PKCS) series.

432 questions
6
votes
1 answer

For PBKDF2, using HMAC-SHA256 is more secure than using HMAC-SHA-1?

I'm looking for the proper Java algorithm for password encryption, and I found that Java SDK provides PBKDF2WithHmacSHA1, but not PBKDF2WithHmacSHA256. I heard that HMAC-SHA256 will take more time than HMAC-SHA-1 does. Since system resources are…
hotohoto
  • 490
  • 8
  • 20
6
votes
1 answer

Encryption of String AES PBKDF2

I am new to encryption, I used encryption techniques of all types,but client particularly asking about PBKDF2 encryption technique. Any Help?
user3149246
  • 162
  • 1
  • 7
6
votes
1 answer

PBKDF2 with HMAC in Java

I am working on a Java project where I must ensure the confidentiality and integrity of users password saved in a plaintext file. To do so, I will write only a hash of the password in the file. More specifically, my intention is to write the hash…
papafe
  • 2,959
  • 4
  • 41
  • 72
6
votes
2 answers

crypto.pbkdf2 is asynchronous, how do I treat it as synchronous?

I'm using pbkdf2 in node.js for hashing passwords. My problem is that I'm responding to a request for authentication and I'm in the middle of authenticating if the passed credentials are correct. I'm presuming that pbkdf2 is async as it could…
Metalskin
  • 3,998
  • 5
  • 37
  • 61
6
votes
3 answers

How to properly store a PBKDF2 password hash

I have been doing some research for proper ways to hash/encrypt a password and store it in a database. I knew about Salt and Hashing so I looked around and PBKDF2 seemed to be a good choice. So I've found this website that gave a good tutorial on it…
Alex
  • 298
  • 1
  • 3
  • 12
5
votes
5 answers

NodeJS implementation for Python's pbkdf2_sha256.verify

I have to translate this Python code to NodeJS: from passlib.hash import pbkdf2_sha256 pbkdf2_sha256.verify('12345678', '$pbkdf2-sha256$2000$8R7jHOOcs7YWImRM6V1LqQ$CIdNv8YlLlCZfeFJihZs7eQxBsauvVfV05v07Ca2Yzg') >> True The code above is the entire…
Alexander
  • 7,484
  • 4
  • 51
  • 65
5
votes
2 answers

Java Cipher - PBE thread-safety issue

It seems that I have a thread-safety issue with Cipher and/or PBEKeySpec. JDK : 1.8.0_102, 1.8.0_151 and 9.0.1+11 PBKDF2 algorithm: PBKDF2WithHmacSHA1 Cipher algorithm: AES/CFB/NoPadding Key algorithm: AES I know these classes aren't tread-safe if…
Laymain
  • 1,450
  • 18
  • 25
5
votes
3 answers

Convert C# PBKDF2 using Rfc2898DeriveBytes to PHP

Long story short have a membership system built in .NET that we are porting to WordPress and need to replicate the PBKDF2 encryption so users don't need to reset their passwords. Using a know hashed password I've been able to replicate this in .NET…
philba888
  • 125
  • 2
  • 10
5
votes
2 answers

PBKDF2 implementation in OpenSSL

I am using OpenSSl in DevC. I was having a problem programming the PBKDF. A person suggested that I use the default function called PKCS5_PBKDF2_HMAC . I have visited many links online but cannot get this to work.My code from the main() is as…
5
votes
1 answer

What are the correct settings for crypto.pbkdf2 to derive IV and key to crypto.createCipheriv?

In an application in node.js, I am using crypto module for symmetric encryption/decryption. I am using AES-256-CTR. I originally assumed the crypto.createCipher will be "just working" and "handwaved" the details. Now I am reading in the…
Karel Bílek
  • 36,467
  • 31
  • 94
  • 149
5
votes
1 answer

CryptoJs's decrypt method returns an empty string

I am trying to encrypt/decrypt using AES256 using Java for encryption and CryptoJS for decryption. Encryption is tested in Java is working fine but the decryption method in JavaScript is returning an empty string. Please note in order to test…
marios390
  • 93
  • 1
  • 6
5
votes
1 answer

What does PKCS5_PBKDF2_HMAC_SHA1 return value mean?

I'm attempting to use OpenSSL's PKCS5_PBKDF2_HMAC_SHA1 method. I gather that it returns 0 if it succeeds, and some other value otherwise. My question is, what does a non-zero return value mean? Memory error? Usage error? How should my program handle…
jtpereyda
  • 6,987
  • 10
  • 51
  • 80
5
votes
1 answer

Utilizing PBKDF2 with OpenSSL library

I want to utilize the PBKDF2 algorithm with SHA1 HMAC (based on this answer). How can I utilize this through the crypto library? I started by looking at man openssl, but the openssl passwd command (man page) only supports a small handful of…
jtpereyda
  • 6,987
  • 10
  • 51
  • 80
5
votes
1 answer

How can PBKDF2 using HMAC SHA-1 return more than 20 bytes?

If Node's crypto.PBKDF2 uses HMAC SHA-1, how can the key length ever be more than 20 bytes? Here's what I understand (apparently incorrectly): crypto.PBKDF2(password, salt, iterations, keylen, callback) uses HMAC SHA-1 to hash a password with a…
Mike M. Lin
  • 9,992
  • 12
  • 53
  • 62
4
votes
0 answers

Getting java.lang.RuntimeException: PBKDF2 algorithm not found error

I built a new keycloak image using the instructions mentioned in https://hub.docker.com/r/jboss/keycloak/ under "Building image with Keycloak from different sources". It was working fine till last week but when I tried to build new image again, I am…
sagun
  • 93
  • 1
  • 4