[advanced search]
Results from the most recent live auction are here.
30 members in the live chat room. Join Chat!
Register Rules & FAQ NP$ Store Active Threads Mark Forums Read
Go Back   NamePros.Com > Design and Development > Webmaster Tutorials
User Name
Password

Closed Thread
 
Thread Tools
Old 03-04-2006, 01:29 PM   · #1
asgsoft
NamePros Regular
 
asgsoft's Avatar
 
Location: At Home
Trader Rating: (36)
Join Date: Sep 2005
Posts: 806
NP$: 981.10 (Donate)
asgsoft is just really niceasgsoft is just really niceasgsoft is just really niceasgsoft is just really niceasgsoft is just really nice
Md5()

MD5, a hash encrytion of texts. although it is supposed to be uncovertable it can be converted back recently. it is a very easy function to use but uesed a lot in sending encrypted data and storing it, like this forum it uses it to store passwords. this is how it works:
PHP Code:
$text="test text";
$encrypted= md5($text);
echo
$encrypted;

this will ouput 1e2db57dd6527ad4f8f281ab028d2c70. but to make it more secure like what IPB does it to double encypt it. so it looks like this:
PHP Code:
$text="test text";
$encrypted= md5(md5($text));
echo
$encrypted;

this will output: a932721fa7514980123ca95f1e94cb47 which is harder to crack becuase it is an encrytption of an encryptiom.

hope that helps.


Please register or log-in into NamePros to hide ads
asgsoft is offline   Reply With Quote
Old 05-10-2006, 06:53 AM   · #2
RickM
www.RickyMills.com
 
RickM's Avatar
 
Name: Rick Mills
Location: Herts, UK
Trader Rating: (92)
Join Date: Sep 2005
Posts: 3,548
NP$: 1217.52 (Donate)
RickM has much to be proud ofRickM has much to be proud ofRickM has much to be proud ofRickM has much to be proud ofRickM has much to be proud ofRickM has much to be proud ofRickM has much to be proud ofRickM has much to be proud ofRickM has much to be proud ofRickM has much to be proud of
Cancer Survivorship Save The Children Save The Children Cancer Animal Cruelty Child Abuse Cancer Survivorship 9/11/01 :: Never Forget Animal Cruelty Child Abuse Animal Rescue Animal Cruelty Protect Our Planet Protect Our Planet Protect Our Planet
A better sollution is sh1

it works exactly the same as md5 except you replace md5 with sh1.

Combine this with ROT13 and salt and you have secure encryption
__________________
WSDReg - $7.99 .MOBI | $2.89 .INFO | .ME PRE-REGISTRATIONS!


15% OFF EVERYTHING @ NOCSTER.NET! GET YOURSELF A SERVER FOR UNDER $60!
(PM me to place an order!)
RickM is offline   Reply With Quote
Old 05-10-2006, 09:46 AM   · #3
asgsoft
NamePros Regular
 
asgsoft's Avatar
 
Location: At Home
Trader Rating: (36)
Join Date: Sep 2005
Posts: 806
NP$: 981.10 (Donate)
asgsoft is just really niceasgsoft is just really niceasgsoft is just really niceasgsoft is just really niceasgsoft is just really nice
do you have any code examples?
asgsoft is offline   Reply With Quote
Old 05-10-2006, 11:29 AM   · #4
dhscott
Senior Member
 
dhscott's Avatar
 
Name: Daz
Location: London, UK
Trader Rating: (23)
Join Date: Apr 2006
Posts: 1,346
NP$: 280.40 (Donate)
dhscott is a name known to alldhscott is a name known to alldhscott is a name known to alldhscott is a name known to alldhscott is a name known to alldhscott is a name known to all
The only things I can think of that would require MD5() are for logins. For that you need a database, MySQL goes well with PHP.

An example I found on the net can be found here. I haven't tried it out yet, but I intend to later on just to see how it works. It requires MySQL.

Judging by reading the summary, it MD5's on the clientside and macthes it up on the serverside instead of sending a plain-text password as it were... I'm confused now!

Bah, i'll find an easier example that's easy to get!
dhscott is offline   Reply With Quote
Old 05-10-2006, 12:36 PM   · #5
asgsoft
NamePros Regular
 
asgsoft's Avatar
 
Location: At Home
Trader Rating: (36)
Join Date: Sep 2005
Posts: 806
NP$: 981.10 (Donate)
asgsoft is just really niceasgsoft is just really niceasgsoft is just really niceasgsoft is just really niceasgsoft is just really nice
I ment for rmwebs's post?

How will the code look like?
asgsoft is offline   Reply With Quote
Old 05-10-2006, 01:14 PM   · #6
dhscott
Senior Member
 
dhscott's Avatar
 
Name: Daz
Location: London, UK
Trader Rating: (23)
Join Date: Apr 2006
Posts: 1,346
NP$: 280.40 (Donate)
dhscott is a name known to alldhscott is a name known to alldhscott is a name known to alldhscott is a name known to alldhscott is a name known to alldhscott is a name known to all
D'oh! Didn't see you wrote the thread!

Not familiar with ROT13 either, what is this?
dhscott is offline   Reply With Quote
Old 05-10-2006, 03:54 PM   · #7
Tree
NamePros Regular
 
Tree's Avatar
 
Name: Trevor
Location: Atlanta, GA, USA
Trader Rating: (3)
Join Date: Feb 2006
Posts: 331
NP$: 0.00 (Donate)
Tree will become famous soon enoughTree will become famous soon enough
ROT13 advances letters thirteen characters.

a = n
b = o
c = p
etc, etc.

More on MD5
Too much about MD5
__________________
NCIDev.com
Tree is offline   Reply With Quote
Old 05-10-2006, 05:18 PM   · #8
SecondVersion
while ($awake){ code(); }
 
SecondVersion's Avatar
 


Name: Eric
Location: Kentucky
Trader Rating: (137)
Join Date: Mar 2005
Posts: 4,135
NP$: 1525.00 (Donate)
SecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond repute
Member of the Month
MOTM September 2005 Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Cancer Alzheimer's Protect Our Planet
Originally Posted by rmwebs
A better sollution is sh1

it works exactly the same as md5 except you replace md5 with sh1.

Combine this with ROT13 and salt and you have secure encryption


I believe you mean sha1

www.php.net/sha1
__________________
6k.org @ Sedo auction
SecondVersion.com - The Personal Blog of SecondVersion
Domain Name Portfolio - Get your free copy. - Version 1.0.1 now available!!
MetaCreator.com - Free Meta Tag Creator
SecondVersion is offline   Reply With Quote
Old 05-11-2006, 04:22 AM   · #9
kiore
NamePros Regular
 
Name: Bruce Clement
Location: Auckland, New Zealand
Trader Rating: (2)
Join Date: Nov 2005
Posts: 232
NP$: 790.00 (Donate)
kiore has a spectacular aura aboutkiore has a spectacular aura about
Originally Posted by rmwebs
Combine this with ROT13 and ...



Better still, for extra security, double encrypt with ROT13.
__________________
Blog: Domaining .NZ | Sales: Hot Domains | Portfolio: Rare Domains
kiore is offline   Reply With Quote
Old 05-11-2006, 09:47 AM   · #10
J4m!3
NamePros Regular
 
J4m!3's Avatar
 
Name: Jamie
Location: Clevedon, UK
Trader Rating: (9)
Join Date: Oct 2005
Posts: 198
NP$: 25.00 (Donate)
J4m!3 will become famous soon enoughJ4m!3 will become famous soon enough
Wow im confused lol
J4m!3 is offline   Reply With Quote
Old 05-31-2006, 07:22 AM   · #11
RickM
www.RickyMills.com
 
RickM's Avatar
 
Name: Rick Mills
Location: Herts, UK
Trader Rating: (92)
Join Date: Sep 2005
Posts: 3,548
NP$: 1217.52 (Donate)
RickM has much to be proud ofRickM has much to be proud ofRickM has much to be proud ofRickM has much to be proud ofRickM has much to be proud ofRickM has much to be proud ofRickM has much to be proud ofRickM has much to be proud ofRickM has much to be proud ofRickM has much to be proud of
Cancer Survivorship Save The Children Save The Children Cancer Animal Cruelty Child Abuse Cancer Survivorship 9/11/01 :: Never Forget Animal Cruelty Child Abuse Animal Rescue Animal Cruelty Protect Our Planet Protect Our Planet Protect Our Planet
*a little bumpy update*

SHA1:
PHP Code:
<?php    
if($_POST['go'] == 'Go')
{
    echo
sha1($_POST['text']);
} else {
echo
"<form method='post' action='encrypt.php'>
<input type='text' name='text'> <input type='submit' name='go' value='Go'>
</form>"
;
}
?>


That gives the SHA1 output.
For extra security:

PHP Code:
<?php    
if($_POST['go'] == 'Go')
{
    echo
sha1(md5(str_rot13($_POST['text'])));
} else {
echo
"<form method='post' action='encrypt.php'>
<input type='text' name='text'> <input type='submit' name='go' value='Go'>
</form>"
;
}
?>


The above will do SHA1, MD5 and then ROT13
__________________
WSDReg - $7.99 .MOBI | $2.89 .INFO | .ME PRE-REGISTRATIONS!


15% OFF EVERYTHING @ NOCSTER.NET! GET YOURSELF A SERVER FOR UNDER $60!
(PM me to place an order!)
RickM is offline   Reply With Quote
Old 05-31-2006, 08:35 AM   · #12
dchesterton
NamePros Member
 
dchesterton's Avatar
 
Name: Daniel
Location: Essex, United Kingdom
Trader Rating: (9)
Join Date: Aug 2005
Posts: 139
NP$: 159.45 (Donate)
dchesterton will become famous soon enoughdchesterton will become famous soon enough
Quote:
although it is supposed to be uncovertable it can be converted back recently

This statement is 100% false. You cannot convert back MD5, it is true that collisions have been found but all that means is that two different strings produce the same hash. They are still nearly impossible to find.

Any encryption is prone to dictionary attacks if you don't include a salt. An MD5 encryption with a salt will be more than enough for many sites out there although if you are serious about security I would recommend hashing with SHA256 or even SHA512 and including a pre-set SALT that only you know and a random SALT which will be stored in the database with the password. That way even if a user gets the hashed password and the SALT they still cannot use a dictionary attack as they do not have the secret salt that only you know.

Quote:
The only things I can think of that would require MD5() are for logins. For that you need a database, MySQL goes well with PHP.

An example I found on the net can be found here. I haven't tried it out yet, but I intend to later on just to see how it works. It requires MySQL.

Judging by reading the summary, it MD5's on the clientside and macthes it up on the serverside instead of sending a plain-text password as it were... I'm confused now!

You are correct that passwords are normally stored in a MySql database, but what if somebody (even a site admin) gains access to the database? The passwords are there in plain-text. If they are hashed (not encrypted, two totally different things) then it's impossible to find the users' password.

Unfortunately the password's will still be sent in plaintext from the client to the server, this is where SSL certificates are needed.

I have also heard, might not be completely true but if you hash an already hashed string it increases the chance of collisions. Don't ask me how though

Hope that all made sense
dchesterton is offline   Reply With Quote
Old 05-31-2006, 09:06 AM   · #13
RickM
www.RickyMills.com
 
RickM's Avatar
 
Name: Rick Mills
Location: Herts, UK
Trader Rating: (92)
Join Date: Sep 2005
Posts: 3,548
NP$: 1217.52 (Donate)
RickM has much to be proud ofRickM has much to be proud ofRickM has much to be proud ofRickM has much to be proud ofRickM has much to be proud ofRickM has much to be proud ofRickM has much to be proud ofRickM has much to be proud ofRickM has much to be proud ofRickM has much to be proud of
Cancer Survivorship Save The Children Save The Children Cancer Animal Cruelty Child Abuse Cancer Survivorship 9/11/01 :: Never Forget Animal Cruelty Child Abuse Animal Rescue Animal Cruelty Protect Our Planet Protect Our Planet Protect Our Planet
Actualy, MD5 can be decrypted...it has only recently been found out though.

I wont post code up here that will prove this as i wouldnt want to create security problems for anyone, however i can assure you - MD5 is very decryptable...i have been able to decrypt upto 10 chars so far, and im sure others have got furthur.

I would appreciate it if people stopped PMing me asking for the code...regardless of your reasoning, i would prefer not to release it.

You can find it the same way i did...www.google.com
__________________
WSDReg - $7.99 .MOBI | $2.89 .INFO | .ME PRE-REGISTRATIONS!


15% OFF EVERYTHING @ NOCSTER.NET! GET YOURSELF A SERVER FOR UNDER $60!
(PM me to place an order!)
RickM is offline   Reply With Quote
Old 05-31-2006, 02:24 PM   · #14
Scott
Senior Member
 
Scott's Avatar
 
Location: UK
Trader Rating: (180)
Join Date: Jun 2003
Posts: 3,759
NP$: 15.00 (Donate)
Scott has a reputation beyond reputeScott has a reputation beyond reputeScott has a reputation beyond reputeScott has a reputation beyond reputeScott has a reputation beyond reputeScott has a reputation beyond reputeScott has a reputation beyond reputeScott has a reputation beyond reputeScott has a reputation beyond reputeScott has a reputation beyond reputeScott has a reputation beyond repute
Member of the Month
February 2005 Save The Children Save The Children Save The Children Save The Children Save The Children
MD5 can't be decrypted... MD5 produces a cryptographic hash. A hash cannot be decrypted or "converted back". MD5 is still very safe if used with a salt.
Scott is offline   Reply With Quote
Old 05-31-2006, 04:01 PM   · #15
NetworkTown.Net
Senior Member
 
Name: Soon....
Location: United Kingdom
Trader Rating: (27)
Join Date: Oct 2005
Posts: 1,550
NP$: 49.74 (Donate)
NetworkTown.Net is just really niceNetworkTown.Net is just really niceNetworkTown.Net is just really niceNetworkTown.Net is just really nice
Originally Posted by Scott
MD5 can't be decrypted... MD5 produces a cryptographic hash. A hash cannot be decrypted or "converted back". MD5 is still very safe if used with a salt.



well i just did a google search and found a site that can decrypt md5 i tried it and worked.
__________________
PHP2k.com - PHP Coder[B]
NetworkTown.Net is offline   Reply With Quote
Old 05-31-2006, 04:22 PM   · #16
Scott
Senior Member
 
Scott's Avatar
 
Location: UK
Trader Rating: (180)
Join Date: Jun 2003
Posts: 3,759
NP$: 15.00 (Donate)
Scott has a reputation beyond reputeScott has a reputation beyond reputeScott has a reputation beyond reputeScott has a reputation beyond reputeScott has a reputation beyond reputeScott has a reputation beyond reputeScott has a reputation beyond reputeScott has a reputation beyond reputeScott has a reputation beyond reputeScott has a reputation beyond reputeScott has a reputation beyond repute
Member of the Month
February 2005 Save The Children Save The Children Save The Children Save The Children Save The Children
Originally Posted by gameztown
well i just did a google search and found a site that can decrypt md5 i tried it and worked.



OK. "Decrypt" this: 981d5552164c6b0865a9c161432c290e
Scott is offline   Reply With Quote
Old 05-31-2006, 04:41 PM   · #17
dchesterton
NamePros Member
 
dchesterton's Avatar
 
Name: Daniel
Location: Essex, United Kingdom
Trader Rating: (9)
Join Date: Aug 2005
Posts: 139
NP$: 159.45 (Donate)
dchesterton will become famous soon enoughdchesterton will become famous soon enough
Well please provide a link then. It is impossible to decrypt a hash, there is a difference between encryption and hashing. I'm guessing the site these people are referring to is http://www.md5decrypt.com/, try it with a string you have hashed and funnily enough it throws up an error, good isn't it! That site can only decrypt strings you have put into it, obviously it keeps a database of all strings entered and then tries to find a match.

When will you people learn that it's impossible to decrypt a proper md5 hash. It takes supercomputers weeks just to find a collision.
dchesterton is offline   Reply With Quote
Old 06-01-2006, 01:00 PM   · #18
PoorDoggie
Soon to be RICHdoggie!
 
PoorDoggie's Avatar
 
Name: Tom
Location: UK
Trader Rating: (36)
Join Date: Jan 2005
Posts: 2,390
NP$: 300.50 (Donate)
PoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nice
Originally Posted by Scott
OK. "Decrypt" this: 981d5552164c6b0865a9c161432c290e


heh... a very badly scripted error!
PoorDoggie is offline   Reply With Quote
Old 06-01-2006, 02:22 PM   · #19
dhscott
Senior Member
 
dhscott's Avatar
 
Name: Daz
Location: London, UK
Trader Rating: (23)
Join Date: Apr 2006
Posts: 1,346
NP$: 280.40 (Donate)
dhscott is a name known to alldhscott is a name known to alldhscott is a name known to alldhscott is a name known to alldhscott is a name known to alldhscott is a name known to all
If in doubt, hash it twice! (md5(md5))

I know wordpress does...
dhscott is offline   Reply With Quote
Old 06-01-2006, 02:31 PM   · #20
PoorDoggie
Soon to be RICHdoggie!
 
PoorDoggie's Avatar
 
Name: Tom
Location: UK
Trader Rating: (36)
Join Date: Jan 2005
Posts: 2,390
NP$: 300.50 (Donate)
PoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nice
Originally Posted by qwhois
If in doubt, hash it twice! (md5(md5))

I know wordpress does...


I do this:

PHP Code:
$str = "hello"; // string

$md5 = md5($str); // md5 the string

$new = substr($md5, 16).substr($md5, 0, 16); // put first 16 chars after first 16...

$last = md5($new); // md5 the resulting string...


but then again, maybe I am going over the top...



Tom
PoorDoggie is offline   Reply With Quote
Old 06-11-2006, 02:57 AM   · #21
wackyjoe
NamePros Regular
 
Trader Rating: (4)
Join Date: Dec 2005
Posts: 206
NP$: 270.00 (Donate)
wackyjoe is on a distinguished road
md5() is decryptable, but it can take a while to do so depending on the chars. If it is combined with Aa1-10*#@#$% well it would take days to decrypt...if it is a simple "hello" it will take around 10mins maybe...

But yes people have been able to decrypt it through dictionary words, brute force attacks.

md5 and sha1 are both decryptable...if you really are that desperate i can show u a screen shot .. if it is allowed by the board admin ofcourse

Linux decrypters are alot quicker then windows and they do it in nerly half the time aswell.

as mentioned above, you can prevent this by ofcourse using a salt.


No matter how much of an encryption you do create SOMEONE will be able to get around it someday

Last edited by wackyjoe : 06-11-2006 at 03:05 AM.
wackyjoe is offline   Reply With Quote
Old 06-11-2006, 03:00 AM   · #22
Scott
Senior Member
 
Scott's Avatar
 
Location: UK
Trader Rating: (180)
Join Date: Jun 2003
Posts: 3,759
NP$: 15.00 (Donate)
Scott has a reputation beyond reputeScott has a reputation beyond reputeScott has a reputation beyond reputeScott has a reputation beyond reputeScott has a reputation beyond reputeScott has a reputation beyond reputeScott has a reputation beyond reputeScott has a reputation beyond reputeScott has a reputation beyond reputeScott has a reputation beyond reputeScott has a reputation beyond repute
Member of the Month
February 2005 Save The Children Save The Children Save The Children Save The Children Save The Children
Originally Posted by wackyjoe
md5() is decryptable, but it can take a while to do so depending on the chars. If it is combined with Aa1-10*#@#$% well it would take days to decrypt...if it is a simple "hello" it will take around 10mins maybe...

But yes people have been able to decrypt it through dictionary words, brute force attacks.

md5 and sha1 are both decryptable...if you really are that desperate i can show u a screen shot .. if it is allowed by the board admin ofcourse

Linux decrypters are alot quicker then windows and they do it in nerly half the time aswell.

No matter how much of an encryption you do create SOMEONE will be able to get around it someday




Originally Posted by Scott
OK. "Decrypt" this: 981d5552164c6b0865a9c161432c290e



Scott is offline   Reply With Quote