PHP encryption
Moderator: General Moderators
PHP encryption
Hi! I'm a newbie in PHP
how can i encrypt password using PHP? 
- shiznatix
- DevNet Master
- Posts: 2745
- Joined: Tue Dec 28, 2004 5:57 pm
- Location: Tallinn, Estonia
- Contact:
Re: PHP encryption
mcrypt
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
Re: PHP encryption
EDIT | It might be worth noting that when you suggest encrypting a password, encrypting is not *exactly* what you are doing as "encryption" typically implies "decryption" using a public or private key. Passwords are usually "hashed" using a one-way function (md5, sha256, etc) and are generally not considered reversible or decryptable.
So while the results are certainly "cryptic" I would be careful adding the "en" to that term as most password hashes (in theory) are not supposed to be reversible.
END EDIT |
Alternatively you might consider using md5() -- although sha256 is better.
So while the results are certainly "cryptic" I would be careful adding the "en" to that term as most password hashes (in theory) are not supposed to be reversible.
END EDIT |
Alternatively you might consider using md5() -- although sha256 is better.
Re: PHP encryption
Those are hashes, not encryption. You can't recover a hash back to its original state (at least in theory).Alternatively you might consider using md5() -- although sha256 is better.
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
Re: PHP encryption
I actually edited before you could correct me...either you missed it or you don't like reading anything I writeThose are hashes, not encryption. You can't recover a hash back to its original state (at least in theory).
- JAB Creations
- DevNet Resident
- Posts: 2341
- Joined: Thu Jan 13, 2005 6:44 pm
- Location: Sarasota Florida
- Contact:
Re: PHP encryption
Mordred had a very nice reply in an earlier thread I started.
Re: PHP encryption
oops, missed itI actually edited before you could correct me...either you missed it or you don't like reading anything I write
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
Re: PHP encryption
Haha...it's all good...I was just teasing...

- JAB Creations
- DevNet Resident
- Posts: 2341
- Joined: Thu Jan 13, 2005 6:44 pm
- Location: Sarasota Florida
- Contact:
Re: PHP encryption
pytrin, good to see you finally added an avatar!
Now if PCSpectra would only honor us with some eye candy.
Now if PCSpectra would only honor us with some eye candy.
Re: PHP encryption
actually I had an avatar for a long time.. I just changed it recently
Re: PHP encryption
Im certain mysql has a function to calculate a passwords md5 hash value and store that value instead of the text.
a way to do it would be to use this function then in you form have some JavaScript validation to confirm the passwords are a match before inserting the data for calculation.
when a user inputs there password to logon you will need to calculate its md5 hash value then confirm it with the database record if a match forward to page ect else password incorrect.
Cheers,
Justin
a way to do it would be to use this function then in you form have some JavaScript validation to confirm the passwords are a match before inserting the data for calculation.
when a user inputs there password to logon you will need to calculate its md5 hash value then confirm it with the database record if a match forward to page ect else password incorrect.
Cheers,
Justin