A hash algorithm is a function which takes a variable size input and produces a fixed size output. The algorithm tries to make it difficult to predict the output for a given input, find two inputs with the same output, or reconstruct the input from the output.
197
votes
9answers
20k views
Is my developer's home-brew password security right or wrong, and why?
Our developer, let's call him 'Dave', insists on using a home-brew script for hashing passwords. See Dave's proposal below.
We have already researched and adopted an industry standard protocol using ...
168
votes
4answers
41k views
Do any security experts recommend bcrypt for password storage?
On the surface bcrypt, an 11 year old security algorithm designed for hashing passwords by Niels Provos and David Mazieres, which is based on the initialization function used in the NIST approved ...
122
votes
7answers
8k views
How to store salt?
Nowadays, if we expect to store user password securely, we need at least do the following thing
$pwd=hash(hash($password) + salt)
then store $pwd in your system instead of the real password. I have ...
114
votes
11answers
14k views
How to securely hash passwords?
If I hash passwords before storing them in my database, is that sufficient to prevent them being recovered by anyone?
I should point out that this relates only to retrieval directly from the ...
61
votes
11answers
8k views
Why are hash functions one way? If I know the algorithm, why can't I calculate the input from it?
Why can't a password hash be reverse engineered?
I've looked into this ages ago and have read lots on it, but I can't find the explanation of why it can't be done. An example will make it easier to ...
60
votes
13answers
5k views
VP of IT claims he unhashed 100% of all 16k employees' PWs. Is he lying to us?
I work for a company which has ~16,000 employees. Periodically, our VP of IT sends out a newsletter with "tech-tips" and misc IT stuff. The topic of this week's newsletter was "password security". ...
43
votes
2answers
5k views
What are rainbow tables and how are they used?
Where can I find one? Is there a pot of gold at the end?
How do I protect against them?
From the Area51 proposal
This question was IT Security Question of the Week.
Read the Sep 09, 2011 blog ...
41
votes
5answers
5k views
Is sending password to user email secure?
How secure is sending passwords through email to a user, since email isn't secured by HTTPS.
What is the best way to secure it? Should i use encryption?
37
votes
5answers
2k views
Password security in databases - today still best practice? [duplicate]
Possible Duplicate:
Which password hashing method should I use?
There are a ton of great posts about password security in databases on stack overflow and on other sites and as I am ...
35
votes
4answers
4k views
Recommended # of iterations when using PKBDF2-SHA256?
I'm curious if anyone has any advice or points of reference when it comes to determining how many iterations is 'good enough' when using PBKDF2 (specifically with SHA-256). Certainly, 'good enough' is ...
34
votes
4answers
11k views
Password Hashing add salt + pepper or is salt enough?
Please Note: I'm aware that the proper method for secure password storage hashing is either scrypt or bcrypt. This question isn't for implementation in actual software, it's for my own understanding.
...
33
votes
7answers
2k views
“Real” Salt and “Fake” Salt
During a Q&A period at DEFCON this year, one member of the audience mentioned that we're using "fake salt" when concatenating a random value and a password before hashing. He defined "real salt" ...
29
votes
3answers
1k views
Security Review - password_hash implementation for PHP
I'm currently working on a "helper function" for PHP's core to make password hashing more secure and easier for the majority of developers. Basically, the goal is to make it so easy, that it's harder ...
27
votes
16answers
4k views
Why do people think that this is bad way to hash passwords?
Well, please tell me, what's wrong with this code:
$password = "hello";
$password = md5($password);
for($i=1;$i<20;$i++){
$password = md5($password);
}
It's exactly the same as this one:
...
25
votes
8answers
2k views
Why would salt not have prevented LinkedIn passwords from getting cracked?
In this interview posted on Krebs on Security, this question was asked and answered:
BK: I’ve heard people say, you know this probably would not have
happened if LinkedIn and others had salted ...
25
votes
2answers
2k views
Pre-hash password before applying bcrypt to avoid restricting password length
Good practice is not to unnecessarily restrict password length, so that appropriately-long passphrases (perhaps 35-45 chars for 6/7 dicewords) can be used. (See e.g. Should I have a maximum password ...
23
votes
5answers
1k views
How does hashing work?
I have been interested in Information Security. I was recently introduced to the idea of hashing. What I currently understand about hashing is that it takes the password a user enters. Then it ...
23
votes
4answers
8k views
Are salted SHA-256/512 hashes still safe if the hashes and their salts are exposed?
Scenario: a database of hashed and and salted passwords, including salts for each password, is stolen by a malicious user. Passwords are 6-10 chars long and chosen by non-technical users.
Can this ...
22
votes
7answers
3k views
Is salting a hash really as secure as common knowledge implies?
(I did search on this topic, but I found no complete question/answer that addressed it, or even good portions of questions that might be relevant.)
I'm implementing a salt function for user passwords ...
22
votes
4answers
3k views
Why AES is not used for secure hashing, instead of SHA-x?
As far as I understand, AES is believed to be extremely secure. (I have read somewhere that it would certainly not be broken in the next 20 years, but I am still not sure if the author was serious.)
...
20
votes
8answers
1k views
Why improvising your own Hash function out of existing hash functions is so bad
I'm afraid I'll have tomatoes thrown at me for asking this old question, but here goes.
After reading that cooking up your own password hash out of existing hashing functions is dangerous over and ...
20
votes
1answer
1k views
Has SHA-3 Arrived?
I know NIST called for contenders (in 2007) regarding the new hash algorithm to replace SHA-2. Has there been a selection, or finalists selected?
20
votes
3answers
825 views
MD5 collision attacks: are they relevant in password hashing?
DISCLAIMER: This is not an endorsement of MD5 as a password hashing function. I know about parallelization, GPUs, and dedicated password hashing functions like bcrypt and scrypt.
With that out of ...
19
votes
3answers
811 views
Am I wrong to believe that passwords should never be recoverable (one way hash)?
I recently forgot my password for our cable provider online account, only to discover that they sent it to us via plain text in an email. I quickly sent an email to customer support asking them if ...
19
votes
5answers
8k views
Most secure password hash algorithm(s)?
What is/are currently the most cryptographically secure hashing algorithm(s)? (available in PHP)
Speed is irrelevant, because I'm iterating the hash over a fixed time (rather than a fixed number of ...
19
votes
2answers
4k views
HMAC - Why not HMAC for password storage?
Nota bene: I'm aware that the good answer to secure password storage is either scrypt or bcrypt. This question isn't for implementation in actual software, it's for my own understanding.
Let's say ...
18
votes
5answers
1k views
What is the point of hashing passwords?
Even when following strict security protocols, and what the user typed is (in this hypothetical situation) completely impossible to derive, the key that the server needs to compare to is still there. ...
18
votes
4answers
4k views
how long does it take to actually generate rainbow tables?
I've been reading up about rainbow tables as I think they're quite interesting cause they're actually a pretty simple concept.
Anyway, I was wondering, has anyone been involved in actually generating ...
18
votes
4answers
1k views
What is SHA-3 and why did we change it?
On the 2nd of October NIST decided that SHA-3 is the new standard hashing algorithm, does this mean we need to stop using SHA-2 as it is not secure?
What is this SHA-3 anyway?
18
votes
1answer
1k views
Collision rate for different hash algorithms
Is there any collision rate measure for popular hashing algorithms (md5, crc32, sha-*)?
If that depends only from output size, it's quite trivial to measure, but I suppose that depends also of ...
18
votes
5answers
710 views
Is it possible to increase the cost of BCrypt or PBKDF2 when its already calculated and without the original password?
I just wanted to know if you can increase the cost (iterations) of those two algorithms off-line.
I want to increase the cost every year of my users passwords.
One solution is to recalculate them ...
17
votes
7answers
2k views
Why don't people hash and salt usernames before storing them
Everyone knows that if they have a system that requires a password to log in, they should be storing a hashed & salted copy of the required password, rather than the password in plaintext.
What I ...
17
votes
4answers
974 views
When hashing passwords, is it ok to use the hashed password as the salt?
I don't like this idea. But I can not come up with a technical argument against it. Can somebody explain it to me? The basic idea is:
$passwd = 'foo';
$salt = hash($passwd);
$finalHash = hash($passwd ...
17
votes
9answers
1k views
Is a simple, but very long password a good password?
Is a password like
wwwwwwwwwwwwwwwwwwwwwwwww9
(25x 'w' and a number) secure? It would be easy to remember.
17
votes
5answers
1k views
What's the practical limit for rainbow-table based bruteforce?
Say we have a hash of a password. The password can be considered to be made of of totally random characters and has a fixed length of N. The hash is SHA1(password+salt), where the salt is of length M. ...
16
votes
9answers
581 views
Does hashing a file from an unsigned website give a false sense of security?
Consider this. Many websites with software downloads also make available MD5 or SHA1 hashes, for users to verify the integrity of the downloaded files. However, few of these sites actually use HTTPS ...
16
votes
3answers
977 views
Is there any advantage to splitting a password?
I've been reading about the LANMAN (LM) hash and I'm curious about a particular part of the algorithm.
The LM hash is computed as follows:
The user’s ASCII password is converted to uppercase.
...
16
votes
3answers
5k views
Is SHA1 better than md5 only because it generates a hash of 160 bits?
It is well known that SHA1 is recommended more than md5 for hashing since md5 is practically broken as lot of collisions have been found.
With the birthday attack, it is possible to get a collision ...
16
votes
5answers
401 views
Hashed password storage with random salt
Ever since I've been making sites that require a user to log in with a username and password I've always kept the passwords somewhat secure by storing them in my database hashed with a salt phrase. ...
16
votes
4answers
524 views
In hashing, does it matter how random a salt is?
I recently had a comment made to me in an online discussion after I'd stated that randomness in a salt doesn't matter -- and I got the following response:
Salts may not have to be "secure," but ...
15
votes
7answers
383 views
To salt, or not to salt? [duplicate]
Possible Duplicate:
Why is using salt more secure?
Why would salt not have prevented LinkedIn passwords from getting cracked?
Recently I decided that I wanted to learn more about web ...
15
votes
2answers
828 views
Salting password with the first 8 bit of the password itself
Do you guys think salting password with the first 8 bit of the password itself will have same result as using stored salt to hash password?
[Clarification]
I am not storing salt but creating from the ...
15
votes
4answers
1k views
Why is using salt more secure?
Storing the hash of users' passwords, e.g. in a database, is insecure since human passwords are vulnerable to dictionary attacks. Everyone suggests that this is mitigated via the use of salts, but the ...
15
votes
3answers
2k views
How would you store a 4 digit pin code securely in the database?
I'm familiar with password hashing, using salts, bcrypt etc.
But it doesn't seem like this would work to store a 4 digit pin code since the attacker could try all 10,000 combinations quite quickly. ...
15
votes
3answers
1k views
MySQL OLD_PASSWORD cryptanalysis?
The password hash used for MySQL passwords prior to version 4.1 (now called OLD_PASSWORD()) seems like a very simple ad-hoc hash, without salts or iteration counts. See e.g an implementation in ...
15
votes
3answers
399 views
What is gained by hashing the last block on-device?
Recently I encountered the notion of "hashing the last block on-device".
It means that when computing a digital signature, the hash that serves as input for the actual signature computation is not to ...
14
votes
9answers
1k views
Can a file contain its md5sum inside it?
Just wondering if it is possible to create a file which has its md5sum inside it along with other contents too.
14
votes
6answers
743 views
Hash function change
I have user account passwords stored in a database using an unsafe (old) cryptographic hash function.
What is the best/usual approach to changing password hash function? Only two ideas come to my ...
14
votes
4answers
746 views
What to transfer? Password or its hash?
Let's say in my database I store passwords hashed with salt with a fairly expensive hash (scrypt, 1000 rounds of SHA2, whatever).
Upon login, what should I transfer over the network and why? Password ...
14
votes
2answers
642 views
Trustworthiness of kernel.org post attack
What are the security implications of the compromise of kernel.org on the trustworthiness of the code base hosted on the site’s Git repository? The announcement today explained the mitigations ...

