FS#13591 - [shadow] Use sha512 hash for passwords for improve local security
Attached to Project:
Arch Linux
Opened by Bruno Tsubouchi Yporti (yportilog) - Saturday, 28 February 2009, 07:52 GMT
Last edited by Dave Reisner (falconindy) - Monday, 28 November 2011, 13:51 GMT
Opened by Bruno Tsubouchi Yporti (yportilog) - Saturday, 28 February 2009, 07:52 GMT
Last edited by Dave Reisner (falconindy) - Monday, 28 November 2011, 13:51 GMT
|
Details
Description: SHA512 is better for protection of local
passwords. Please, change the default configuration of
pam/shadow for use sha512 intead of md5.
I change manually the config in /etc/pam.d/passwd to sha512 and works fine for me. Thanks. |
This task depends upon
I'm not sure I see much downside to switching to something more secure than md5.
Has anyone compared blowfish to sha512, on the merits, for this particular application?
In fact, MD5 has only shown weaknesses in regards to collisions: there are no known feasible preimage attacks on it (i.e. your passwords are still safe).
For better security, I would recommend switching to SHA1 or one of the finalists of the SHA3 competition, when they are announced, in August.
http://csrc.nist.gov/groups/ST/hash/sha-3/
Naturally, we will have to switch to SHA256 (possibly even SHA512) at some point to ensure security in the long term.
What is, however, subject to collision attacks, are the md5sums arrays of PKGBUILDs and %MD5SUM% entries in repository databases. The former can be replaced by sha*sums by the maintainer, but the latter is hardcoded in repo-add and libalpm.
As far as I can tell we are not altering the default from upstream, which is the way it should be (IMHO).
So.. some body change this some day?, is a good option use sha512, fedora, ubuntu etc use sha512 by default
i agree with you regarding is not urgent, but if, from at least 3 years ago some simplier distros (fedora ubuntu debian mint etc) are using it, why not us?
This is very important for me, because i want to use the login password for disk encryption too...
(but i'd like to use home encryption password for loging in completely without shadow in the future)
Here are some tips for "early" adopters: https://wiki.archlinux.org/index.php/SHA_password_hashes
I can also suggest to set some smart default number of rounds to make passwords even more secure...
On my 1.8Ghz Sempron laptop i am using (it takes just the right time to login to not bother me):
password required pam_unix.so sha512 shadow nullok rounds=99999
On quadcore 2.40GHz Xeon server i am using (it takes around second to login):
password required pam_unix.so sha512 shadow nullok rounds=999999
On 900MHz Pentium III personal NAS (with slow i386 debian) i am using (it takes around second to login):
password required pam_unix.so sha512 shadow nullok rounds=65536
Which means that rounds=16384 (which is 2^14 BTW) should be fast enough even on quite slow machines...
It only annoys attackers as much as it annoys users: this is a bad approach to addressing the issue of people choosing poor passwords.
remy: well i am using this just because i am using pam_encfs and try_first_pass. btw if you are compatible with debian you are compatible with everything :)
on i686 i can use john to crack it (using crypt())
on x86_64 i can't :(says it's generic crypt() but unsupported)
sometimes i'd like to check if all users are using relatively strong passwords and this makes it unusable...
But I agree with Remy -- defaults do not matter if you know what you want...
ever heard about sudo or xscreensaver? :)
anyway... archlinux is quite lightweight, so i can imagine someone using it on some quite old (or "quite embeded") machine as router, NAS or whatever...
The number of rounds itself is not so important, because the pws are salted(random salt), but it is less difficult to generate a rainbow table if there are only few rounds or even no extra rounds.
The University of Amerstam showed that (GPU powered) the efficiency falls from 3 Billion (md5) to 30 Million(sha512) hashes per second. That means, for example, a password like "P4ssW0r7" is computed in 14 hours (md5 hash) or 58 days (sha512 hash).
i wonder if its md5(salt.pass) or md5(md5(salt).pass), because the second approach can be even more secure than vast number of rounds...
That should be fine and it is only a small change.
When we talk about security, default configurations should provide a good protection by default for the novice user. (Even if that user is not a novice in computer usage).
Nobody can think on everything, and that's why default configurations are there for.
IMHO, I do agree that this must be changed. MD5 can not be called secure, it has been proved many times.
People who loose their laptops for e.g. or have their laptops stolen. Even with a good password, MD5 is not secure.
Use case :
Let's admit that the user has an encrypted partition and so on. (working for his company, his company has done the necessary for that).
He likes Archlinux, all installed by the IT team, but the team didn't know that Archlinux only used MD5 (they simply forget to check that information).
Okay he got his computer stolen by X or Y interested in his computer and research.
How can you say that his computer is still safe (it will never be, we know that) when you still have an MD5 based log in process ?
I'm running Archlinux, and I've to run an antivirus. (I don't trust it personally, but that's the way the company where I work are protected. They have to be PCI and so they are) I had to change from MD5 to SHA and lot of other security "tricks&fixes".
It was simply mandatory.
In this case I won't think like I would for a home device. Professionals must have a device that they can trust.
Log in and log out must be secured operations. Even if it take 1sec more to do it.
After all Archlinux is a distribution like another one, if now the distribution will start to have dark spots (even if it's little spots) some people might just stop using / allowing it.
In my case of use I bet I MD5 is enough, I'm quite sure that nothing will happen but I can't guarantee it.
The question is, should Archlinux change this behavior ?
IMHO, yes. And most comments here tend to think the same way.
Best regards.
Forgot to mention it, but I also don't support multiple rounds scheme by default.
Encryption software has nothing to do with the present discussion.
I am using same password for encryption and for loging-in and i still believe that it's strong enough to not be cracked when i don't use MD5 in /etc/shadow