Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,471
There are 1106 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     PHP and MySQL :

Password encryption?

Thread title: Password encryption?
Closed Thread  
Page 1 of 4 1 2 3 4 >
    Thread tools Search this thread Display Modes  
02-15-2007, 09:33 AM
#1
Impluo is offline Impluo
Status: We're all mad here
Join date: Aug 2005
Location: Missouri
Expertise: programming
Software: Notepad
 
Posts: 1,606
iTrader: 0 / 0%
 

Impluo is on a distinguished road

  Old  Password encryption?

When you save passwords in a database, how much encryption should you use?

$rand = rand(0,9999);
$password = sha1((md5($password)+$rand),CRYPT);

Would something like this be enough encryption?

02-15-2007, 10:05 AM
#2
Sketch is offline Sketch
Sketch's Avatar
Status: Member
Join date: Aug 2005
Location: Melbourne, Australia
Expertise:
Software:
 
Posts: 419
iTrader: 0 / 0%
 

Sketch is on a distinguished road

  Old

Ah yer that would be more then enough, in fact it would be too much. How are you going to work out what random number you added to the record?

I usally just go md5($password);

However I've started going sha1($password); and I figure thats enough its one way encryption so it should be hard enough.

02-15-2007, 10:27 AM
#3
Impluo is offline Impluo
Status: We're all mad here
Join date: Aug 2005
Location: Missouri
Expertise: programming
Software: Notepad
 
Posts: 1,606
iTrader: 0 / 0%
 

Impluo is on a distinguished road

  Old

I keep hearing people say bad things about using sha1 or md5 alone so I didn't know how far I should actually take it

You could store the random number in the database also .

02-15-2007, 01:51 PM
#4
echoSwe is offline echoSwe
Status: Member
Join date: Jul 2005
Location:
Expertise:
Software:
 
Posts: 185
iTrader: 0 / 0%
 

echoSwe is on a distinguished road

  Old

Use SHA256/SHA2 instead of SHA128/SHA1. SHA1 has security flaws. MD5 is nothing that you should ever use, besides when doing checksums on files.

02-15-2007, 04:40 PM
#5
noodles is offline noodles
Status: Junior Member
Join date: May 2005
Location:
Expertise:
Software:
 
Posts: 44
iTrader: 0 / 0%
 

noodles is on a distinguished road

  Old

Originally Posted by echoSwe View Post
Use SHA256/SHA2 instead of SHA128/SHA1. SHA1 has security flaws. MD5 is nothing that you should ever use, besides when doing checksums on files.
hm everyone here says, you shouldn't use md5... but why? isn't it secure?

02-15-2007, 05:35 PM
#6
Immersion is offline Immersion
Status: Senior Member
Join date: Dec 2005
Location:
Expertise:
Software:
 
Posts: 918
iTrader: 5 / 100%
 

Immersion is on a distinguished road

  Old

there are many md5 library/ crackers now that you just add the hash and it will find wheat the word is. This generally only works with dictionary words.

02-15-2007, 06:04 PM
#7
Amross is offline Amross
Status: Member
Join date: Jan 2007
Location:
Expertise:
Software:
 
Posts: 311
iTrader: 4 / 100%
 

Amross is on a distinguished road

  Old

I don't know what type of site you're seeking encryption for, but if you're merely trying to avoid storing raw passwords on your average site, using a standard method (such as md5 or sha1) along with salting it with an unknown and random (yet static) string should be more than sufficient. There are obviously numerous stronger methods than I mentioned, but they are also less efficient and thus unless needed, wouldn't exactly be practical.

02-15-2007, 08:20 PM
#8
Zara is offline Zara
Status: Member
Join date: Apr 2006
Location:
Expertise:
Software:
 
Posts: 249
iTrader: 9 / 100%
 

Zara is on a distinguished road

  Old

I just stick with md5(md5($password)) It's pretty simple but can easily bypass most of those library's / crackers he was talkin' about...

If you have the registration timestamp in the database you can do md5(md5($password)+$reg_timestamp)

02-16-2007, 02:57 AM
#9
unclekyky is offline unclekyky
unclekyky's Avatar
Status: Junior Member
Join date: May 2005
Location:
Expertise:
Software:
 
Posts: 43
iTrader: 0 / 0%
 

unclekyky is on a distinguished road

  Old

I've heard that you shouldn't hash a hash. It (supposedly) makes the hash have a greater chance of collisions (which is a bad thing).

So doing md5(md5($p)) is not the best way to do things.

Thats what I have been told, so I'm not to sure what to do.

02-16-2007, 04:20 AM
#10
Zara is offline Zara
Status: Member
Join date: Apr 2006
Location:
Expertise:
Software:
 
Posts: 249
iTrader: 9 / 100%
 

Zara is on a distinguished road

  Old

Originally Posted by unclekyky View Post
I've heard that you shouldn't hash a hash. It (supposedly) makes the hash have a greater chance of collisions (which is a bad thing).

So doing md5(md5($p)) is not the best way to do things.

Thats what I have been told, so I'm not to sure what to do.
I've heard nothing about that, and all the large scripts do it this way. vBulletin itself uses md5(md5($password)+$salt)

Closed Thread  
Page 1 of 4 1 2 3 4 >


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed