pbkdf2

Encrypting(MD5) multiple times can improve security?

走远了吗. 提交于 2019-11-30 13:53:07
I saw some guy who encrypt users password multiple times with MD5 to improve security. I'm not sure if this works but it doesn't look good. So, does it make sense? Let's assume the hash function you use would be a perfect one-way function. Then you can view its output like that of a "random oracle" , its output values are in a finite range of values (2^128 for MD5). Now what happens if you apply the hash multiple times? The output will still stay in the same range (2^128). It's like you saying "Guess my random number!" twenty times, each time thinking of a new number - that doesn't make it

Java - PBKDF2 with HMACSHA256 as the PRF

只愿长相守 提交于 2019-11-30 06:30:11
问题 I've been given the task of creating a Login API for our project and I'm supposed to use PBKDF2 with HMACSHA256 as the PRF. The plain text password is hashed using MD5 and then fed into the PBKDF2 to generate a derived key. The problem is, I'm not able to get the same output as what the project documentation is telling me. Here's the PBKDF2 Implementation in Java: public class PBKDF2 { public static byte[] deriveKey( byte[] password, byte[] salt, int iterationCount, int dkLen ) throws java

PBKDF2 implementation in C# with Rfc2898DeriveBytes

霸气de小男生 提交于 2019-11-30 06:20:42
问题 Guys, I'm trying to implement a PBKDF2 function in C# that creates a WPA Shared key. I've found some here: http://msdn.microsoft.com/en-us/magazine/cc163913.aspx that seems to produce a valid result, but it's one byte too short... and the wrong PSK value. To test the output, I am comparing it to this: http://www.xs4all.nl/~rjoris/wpapsk.html or http://anandam.name/pbkdf2/ I did find one way of getting this to work with a built in library to C# called Rfc2898DeriveBytes. Using this, I get a

python passlib: what is the best value for “rounds”

一曲冷凌霜 提交于 2019-11-30 05:34:48
from the passlib documentation For most public facing services, you can generally have signin take upwards of 250ms - 400ms before users start getting annoyed. so what is the best value for rounds in a login/registration if we consider that there is one call for the database for the login attempt, and it uses MongoDB with non-blocking call . (using Mongotor , and using the email as the _id , so it is by default indexed , the query is fast: 0.00299978256226 and of course tested with a database that has 3 records ...) import passlib.hash import time hashh = passlib.hash.pbkdf2_sha512 beg1 = time

Encrypting(MD5) multiple times can improve security?

99封情书 提交于 2019-11-29 19:18:55
问题 I saw some guy who encrypt users password multiple times with MD5 to improve security. I'm not sure if this works but it doesn't look good. So, does it make sense? 回答1: Let's assume the hash function you use would be a perfect one-way function. Then you can view its output like that of a "random oracle", its output values are in a finite range of values (2^128 for MD5). Now what happens if you apply the hash multiple times? The output will still stay in the same range (2^128). It's like you

PBKDF2-HMAC-SHA-512 test vectors

十年热恋 提交于 2019-11-29 03:52:21
I have not been able to find published test vectors for PBKDF2-HMAC-SHA-512. I've built a function that (finally!) reproduces the 7 HMAC-SHA-512 test vectors in RFC 4231 , and the 32-byte test vectors for PBKDF2-HMAC-SHA-256 found in this thread . Here is what it generates for PBKDF2-HMAC-SHA-512. Can anyone help me verify this output? Thanks, Fred Input: P = "password" S = "salt" c = 1 dkLen = 64 Output: DK = 86 7f 70 cf 1a de 02 cf f3 75 25 99 a3 a5 3d c4 af 34 c7 a6 69 81 5a e5 d5 13 55 4e 1c 8c f2 52 c0 2d 47 0a 28 5a 05 01 ba d9 99 bf e9 43 c0 8f 05 02 35 d7 d6 8b 1d a5 5e 63 f7 3b 60 a5

python passlib: what is the best value for “rounds”

馋奶兔 提交于 2019-11-29 03:28:43
问题 from the passlib documentation For most public facing services, you can generally have signin take upwards of 250ms - 400ms before users start getting annoyed. so what is the best value for rounds in a login/registration if we consider that there is one call for the database for the login attempt, and it uses MongoDB with non-blocking call . (using Mongotor, and using the email as the _id , so it is by default indexed , the query is fast: 0.00299978256226 and of course tested with a database

Java - PBKDF2 with HMACSHA256 as the PRF

我与影子孤独终老i 提交于 2019-11-28 19:42:01
I've been given the task of creating a Login API for our project and I'm supposed to use PBKDF2 with HMACSHA256 as the PRF. The plain text password is hashed using MD5 and then fed into the PBKDF2 to generate a derived key. The problem is, I'm not able to get the same output as what the project documentation is telling me. Here's the PBKDF2 Implementation in Java: public class PBKDF2 { public static byte[] deriveKey( byte[] password, byte[] salt, int iterationCount, int dkLen ) throws java.security.NoSuchAlgorithmException, java.security.InvalidKeyException { SecretKeySpec keyspec = new

PBKDF2WithHmacSHA512 Vs. PBKDF2WithHmacSHA1

百般思念 提交于 2019-11-28 17:34:40
I'm working on a Java authentication subsystem that specs the storage of passwords in the DB as PBKDF2 -generated hashes, and I'm now trying to decide whether I should use SHA1 or SHA512 as PFR. I went through the specs of both but they are very mathematically intensive for me to follow. Can somebody with better crypto-understanding explain how PBKDF2WithHmacSHA512 differs from PBKDF2WithHmacSHA1 ? Here's what I'm trying to do: private static final int HASH_BYTE_SIZE = 64; // 512 bits private static final int PBKDF2_ITERATIONS = 1000; // generate random salt SecureRandom random = new

PBKDF2-HMAC-SHA2 test vectors

匆匆过客 提交于 2019-11-28 06:24:47
There are test vectors for PBKDF2-HMAC-SHA1 in RFC6070 . There are test vectors for HMAC-SHA2 in RFC4231 . But so far I haven't found test vectors for PBKDF2-HMAC-SHA2 anywhere. I'm most interested in SHA256, so I'll post some vectors I calculated with my implementation. I'd be happy if someone could verify/confirm them, or contribute their own. aaz I implemented PBKDF2 using the standard hashlib and hmac modules in Python and checked the output against both the RFC 6070 vectors and the vectors you posted – it matches. Here are the vectors I get with a larger dkLen to match the larger digest