Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

PHP Security

Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
Spacemail by SpaceshipSpacemail by Spaceship
Watch

cipcip

Top Member
Impact
1,675
Which password encryption is best for security ? I have read that md5 is not that good... Is it sha1 ? Or which one ?

Thanks!
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
(please delete post)
 
Last edited:
0
Close
Thanks :)
 
0
Close
If you want some hash methods I use feel free to PM me ;)
 
0
Close
I found something about sha512, which is on 512 bits and has about 120 characters. How about this one ?
 
0
Close
Also know as SHA2 (just a note).
Seems to be the best if you plan to do a plain hash.
But requires more processing power(according to wikipedia) and runs best on a 64bit system.
 
1
Close
The totally best way would be to make your own encryption system (which wouldn't be to hard).

No. That is a terrible idea, do not do that. Use sha (with a salt, of course), it is far better than anything you would create.
 
1
Close
0
Close
From what I have seen it's better MD5 but still not the best.
You should Hash it (whether random or pre-defined).
The totally best way would be to make your own encryption system (which wouldn't be to hard).

Developing your own encryption is not the best option. Proper encryption requires a very good understanding of mathematics and prime numbers. You need to ensure that you minimise the potential for example of collisions.

Use a currently accepted encryption algorithm and ensure you use salt when encrypting. The algorithm you should choose depends on the trade-offs between desired security and acceptable processing time.
 
2
Close
Developing your own encryption is not the best option. Proper encryption requires a very good understanding of mathematics and prime numbers. You need to ensure that you minimise the potential for example of collisions.

Use a currently accepted encryption algorithm and ensure you use salt when encrypting. The algorithm you should choose depends on the trade-offs between desired security and acceptable processing time.

Definitely agree with Peter. Use a popular encryption algorithm such as MD5 or SHA.

When people say "use salt" they're referring to adding extra arbitrary text to the actual value you wish to encrypt. For example:

PHP:
<?php
$salt = "H-w_VJe2_u";
md5($password); // no salt
md5($salt + $password); // with salt
?>

Because, obviously, the MD5 value with and without salt will be different. And even though you'd encrypt passwords one-way, you can compare MD5 values and if the password is obvious or is a dictionary word (as an example), two values compared means you can easily figure out the plain-text value of an encrypted password.

There are many websites that exist which has a large database of the decrypted value of encrypted MD5 values. And so if your site's database is compromised, if you don't add a salt to the passwords in your database, many of your user's encrypted passwords will likely be already listed in a database where the MD5 value can be compared because the password has been submitted to such a database before.
 
Last edited:
0
Close
Because, obviously, the MD5 value with and without salt will be different. And even though you'd encrypt passwords one-way, you can compare MD5 values and if the password is obvious or is a dictionary word (as an example), two values compared means you can easily figure out the plain-text value of an encrypted password.

There are many websites that exist which has a large database of the decrypted value of encrypted MD5 values. And so if your site's database is compromised, if you don't add a salt to the passwords in your database, many of your user's encrypted passwords will likely be already listed in a database where the MD5 value can be compared because the password has been submitted to such a database before.

Exactly. They are called Rainbow tables [ame="http://en.wikipedia.org/wiki/Rainbow_table"]Rainbow table - Wikipedia, the free encyclopedia[/ame]

Alot of the recent attacks where hackers like Anonymous released password they didnt actually get the password rather they got hached values. With the use of rainbow tables they can then work out those easy to guess values. They can then use the username and password on other sites to compromise accounts. Anonymous actually encouraged people to try getting into paypal accounts using the details and encouraged them to use the accounts. Hence why it is important to use different passwords on sites.
 
1
Close
Well you can do:

Code:
$input = "something";
$output = hash("sha512", $input);

This way you are not using the + concatenation and it is safer, 512 bits encryption.

This is the best value that I could find... If i use salt, it will be more secure though.
 
0
Close
0
Close
Agreed, hash() is the way to go.

PHP:
$password = hash("sha512", $password);
 
Last edited:
0
Close
[ Removed my post, can't post links and can't delete this :( ]
 
Last edited:
0
Close
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back