Questions tagged [kdf]

A KDF is a Key Derivation Function. A KDF is used within the field of cryptography to generate one or more keys from a seed value. This seed value could be a password or the secret generated by a Diffie Hellman key derivation function. Well known KDF's are crypt, bcrypt, scrypt, PBKDF2 and HKDF. The Password Based Key Derivation Functions are commonly used to securely "hash" a password using an iteration count and a salt.

32 questions
32
votes
1 answer

PBEKeySpec what do the iterationCount and keyLength parameters influence?

Delving into the java encryption and hashing world I see examples of the constructor for the PBEKeySpec class with various values for the iterationCount and the keyLength parameters. Nothing seems to explain what these parameters impact or mean. I…
Mark
  • 803
  • 3
  • 11
  • 21
19
votes
4 answers

Password to key function compatible with OpenSSL commands?

For example, the command: openssl enc -aes-256-cbc -a -in test.txt -k pinkrhino -nosalt -p -out openssl_output.txt outputs something like: key = 33D890D33F91D52FC9B405A0DDA65336C3C4B557A3D79FE69AB674BE82C5C3D2 iv =…
Tudor
  • 4,137
  • 5
  • 38
  • 54
12
votes
1 answer

Generate Derived Key from Shared Secret (ECDH-ES) - ConcatKDF

I have used the https://github.com/ricmoo/GMEllipticCurveCrypto to generate a Shared Secret using ECDH Algorithm. I now have to Generate a Derived Key using the ECDH-ES algorithm as mentioned here:…
Roshit
  • 1,589
  • 1
  • 15
  • 37
4
votes
1 answer

ios SecKeyCopyKeyExchangeResult sharedInfo parameters

Im trying to use the SecKeyCopyKeyExchangeResult function to obtain the shared secret from my local private key and received public key of server. Shared key is generated successfully and I able to decrypt incomming message with AES encryption Not…
Sergey Brazhnik
  • 661
  • 4
  • 13
3
votes
0 answers

AES 256 CBC encrypt with Ruby with OpenSSL not working

I'm trying to encrypt data with OpenSSL library in Ruby using passphrase. Ruby code looks like this: require('openssl') require('base64') cipher = OpenSSL::Cipher.new ('AES-256-CBC') cipher.encrypt cipher.iv = iv = cipher.random_iv pwd =…
mightymatth
  • 93
  • 1
  • 10
3
votes
1 answer

Encrypt (cryptojs) - Decrypt (erlang)

I have a value encrypted with cryptoJS (AES) and need to decrypt using Erlang crypto library. The problem for me lies in the fact that to be able to decrypt in Erlang using aes_cbc_128_decrypt(Key, IVec, Cipher) I presume, I will need to know what…
blackbox
  • 31
  • 1
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

Bouncy Castle Diffie-Hellman KeyAgreement with KDF: What is user keying material?

The Bouncy Castle Diffie-Hellman documentation speaks of using "user keying material" and a KDF when deriving ephemeral keys from a static long term key pair. There is no mention of how to generate this key material. For example, in BCFipsIn100.pdf,…
2
votes
1 answer

ECDH with Bouncy Castle

I have a requirement which states. use, to calculate the Shared Secret Z, the Static Unified Model, C(0e, 2s, ECC CDH)Key Agreement technique (as specified in NIST Special Publication 800-56Ar214 save for the requirement to zeroize the Shared…
Mr.B
  • 41
  • 1
  • 5
2
votes
1 answer

RFC 2246 PRF function in PHP

I've been looking all over for an implementation of the PRF function from RFC 2246. I've found three. One here, one from the openSSL library, and one from wpa_supplicant. They all return different results. So my first question is: is there sample…
Serg
  • 316
  • 2
  • 14
1
vote
0 answers

Google Identity Platform password hashing algorithm

Is anyone able to confirm what is the hashing algorithm used by the Google Identity Platform to store passwords? There is a considerable argument that a secure KDF like Argon2 be used, however seemingly the documentation does not state how passwords…
Kiril
  • 199
  • 2
  • 10
1
vote
1 answer

HMAC Secret key sharing

I want to use HMAC to verify data integrity transmitted between our IOS\Android mobile app and API,I want to prevent data tempering either by authenticated user or man-in-middle, completely trustless. I know we need a shared secret key to be used by…
Baloo0ch
  • 43
  • 1
  • 9
1
vote
1 answer

Calculate TLS PRF Master key using pre master key in Python

I have the following information: "hashAlg": "SHA2-256", "tlsVersion": "v1.2", "keyBlockLength": 1024, "preMasterSecretLength": 384, "preMasterSecret":…
factor2
  • 155
  • 9
1
vote
0 answers

pynacl crypto_core_hsalsa20 for nuki smartlock 2.0

I need the crypto_core_hsalsa20 function to greate an secret key for my NUKI. Both sides calculate DH Key k using function dh1 a. Key 0DE40B998E0E330376F2D2FC4892A6931E25055FD09F054F99E93FECD9BA611E 8. Both sides derive a long term shared secret…
DanielRadl
  • 101
  • 5
1
vote
1 answer

ECDH (secp256r1) + NIST SP 800-56A Concatenation KDF using .NET really not possible in C#?

I know that there are similiar questions here but still I didn't find a clear answer. Is it possible to derive the session key with the .NET library with the given concatenation function without using bouncy castle? It seems that there are some…
Matze28
  • 11
  • 1
1
2 3