[PHP-DB] md5() function

2008-01-14 Thread Miguel Guirao
Hi!!

I'm using the md5() function to encrypt a password and store it into a
database. Now I want to retrieve that MD5 password and convert it into it's
human readable condition.
Is there a function opposite to md5()??

Best Regards,

M Guirao

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] md5() function

2008-01-14 Thread Andrés G. Montañez
MD5 is also known as an one-way crypt system; you can encryptit but
never unencrypted; only using brute force or a hash list you can
retrive a 'string' that it's hash is the one stored; but it is not
necesary the same original string; this is also known as a hash
collision.

So, in short... no, there isn't a unMd5().
If you need to retrive the original string, try GPG.


On 14/01/2008, Miguel Guirao [EMAIL PROTECTED] wrote:
 Hi!!

 I'm using the md5() function to encrypt a password and store it into a
 database. Now I want to retrieve that MD5 password and convert it into it's
 human readable condition.
 Is there a function opposite to md5()??

 Best Regards,

 M Guirao

 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




-- 
Atte, Andrés G. Montañez
Técnico en Redes y Telecomunicaciones
Montevideo - Uruguay

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] md5() function

2008-01-14 Thread Daniel Brown
On Jan 14, 2008 2:26 PM, Miguel Guirao [EMAIL PROTECTED] wrote:
 Hi!!

 I'm using the md5() function to encrypt a password and store it into a
 database. Now I want to retrieve that MD5 password and convert it into it's
 human readable condition.
 Is there a function opposite to md5()??

Negative.  Once it's hashed with an MD5, SHA1, or similar
encryption method, it's (as of now) impossible to reverse.  You could
create a table with a column of unencrypted phrases, characters, and
combinations, with a second column containing the correlating hashed
string, but that's about it.

-- 
/Dan

Daniel P. Brown
Senior Unix Geek and #1 Rated Year's Coolest Guy By Self Since
Nineteen-Seventy-[mumble].

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] md5() function

2008-01-14 Thread Jason Gerfen
Steven Cruz wrote:
 Hello;
 
 I maybe wrong, but I believe it is one way. What you need to do is take
 your input and encrypt it and check if matches your current encrypted
 value. :)
 
 peace and hugs.
 
 Miguel Guirao wrote:
 Hi!!

 I'm using the md5() function to encrypt a password and store it into a
 database. Now I want to retrieve that MD5 password and convert it into
 it's
 human readable condition.
 Is there a function opposite to md5()??

 Best Regards,

 M Guirao

   
 

If you want to do a comparison on the md5() hash you just created you
could always run your SQL query like:

SELECT * FROM `table` WHERE `password` = md5( $password ) LIMIT 1;

That will return a true or false value based on the md5() hash of the
$password var. But you cannot reverse the md5 hash to obtain the
original value unless you perform a crack on it using software available
software. I think what you are looking for is the base64_encode() and
base64_decode() functions which will perform a simple encoding of data.

-- 
Jason Gerfen

I practice my religion
 while stepping on your
 toes...
~The Ditty Bops

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] md5() function

2008-01-14 Thread Steven Cruz

Hello;

I maybe wrong, but I believe it is one way. What you need to do is take 
your input and encrypt it and check if matches your current encrypted 
value. :)


peace and hugs.

Miguel Guirao wrote:

Hi!!

I'm using the md5() function to encrypt a password and store it into a
database. Now I want to retrieve that MD5 password and convert it into it's
human readable condition.
Is there a function opposite to md5()??

Best Regards,

M Guirao

  


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Re: php-db Digest 14 Jan 2008 19:48:27 -0000 Issue 3947

2008-01-14 Thread Peter Westergaard

Miguel -

MD5() is a hash function, not an encryption function. A hash function 
cannot be reversed. 

One of the reasons some sites use MD5() for passwords is so that the 
passwords are never even stored on the server, only the hash.   So even 
the site's database admin can't figure out the passwords of users. 

A hash is a little like a checksum.  Two files can have the same 
checksum even if they're completely different files.  But good luck to 
you if you want to CREATE a file with a specific checksum. 


-Peter





Is there a function opposite to md5()??

  


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Select...

2008-01-14 Thread Miguel Guirao
Hello List,

I'm having kind of trouble to get done this: Select data from a table,
except those data already in a second table. Actually,  if there is a rowid
in table2, I wont get it from table1, rowid is the key that relates both
tables.

I just can't express this with a SQL statement!! idequipomed is the key that
relates both tables!!
So, if idequipomed is already in Table2, I shouldn't get it from Table1.
Any suggestions?

Table1
FieldType NullKey Default Extra
Privileges
---  ---  --  --  --  --
  ---
idequipomed  tinyint(3) unsigned  PRI (NULL)  auto_increment
select,insert,update,references
idcattinyint(3)   0
select,insert,update,references
af   varchar(10)
select,insert,update,references
ns   varchar(10)
select,insert,update,references
deptovarchar(40)  YES (NULL)
select,insert,update,references
zona char(3)
select,insert,update,references
reqcal   char(1)  YES 1
select,insert,update,references
tipocal  char(1)
select,insert,update,references
estado   char(2)
select,insert,update,references
alta date -00-00
select,insert,update,references
ubicacionvarchar(15)  0
select,insert,update,references

Table2
FieldType NullKey Default  Extra
Privileges
---  ---  --  --  ---  --  -
--
calidtinyint(4) unsigned  PRI (NULL)   auto_increment
select,insert,update,references
idequipomed  tinyint(4) unsigned  0
select,insert,update,references
faseid   tinyint(4) unsigned  0
select,insert,update,references
ultimacaldate YES (NULL)
select,insert,update,references
proxcal  date YES (NULL)
select,insert,update,references
idcattinyint(4) unsigned  0
select,insert,update,references


-Original Message-
From: Daniel Brown [mailto:[EMAIL PROTECTED]
Sent: Lunes, 14 de Enero de 2008 01:55 p.m.
To: Miguel Guirao
Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] md5() function


On Jan 14, 2008 2:26 PM, Miguel Guirao [EMAIL PROTECTED]
wrote:
 Hi!!

 I'm using the md5() function to encrypt a password and store it into a
 database. Now I want to retrieve that MD5 password and convert it into
it's
 human readable condition.
 Is there a function opposite to md5()??

Negative.  Once it's hashed with an MD5, SHA1, or similar
encryption method, it's (as of now) impossible to reverse.  You could
create a table with a column of unencrypted phrases, characters, and
combinations, with a second column containing the correlating hashed
string, but that's about it.

--
/Dan

Daniel P. Brown
Senior Unix Geek and #1 Rated Year's Coolest Guy By Self Since
Nineteen-Seventy-[mumble].

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] md5() function

2008-01-14 Thread Miguel Guirao
Thanks every body for your replies!!

It is clear to me that I can not reverse a hased string!!
Thanks!!!

Guirao

-Original Message-
From: Jason Gerfen [mailto:[EMAIL PROTECTED]
Sent: Lunes, 14 de Enero de 2008 02:04 p.m.
Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] md5() function


Steven Cruz wrote:
 Hello;
 
 I maybe wrong, but I believe it is one way. What you need to do is take
 your input and encrypt it and check if matches your current encrypted
 value. :)
 
 peace and hugs.
 
 Miguel Guirao wrote:
 Hi!!

 I'm using the md5() function to encrypt a password and store it into a
 database. Now I want to retrieve that MD5 password and convert it into
 it's
 human readable condition.
 Is there a function opposite to md5()??

 Best Regards,

 M Guirao

   
 

If you want to do a comparison on the md5() hash you just created you
could always run your SQL query like:

SELECT * FROM `table` WHERE `password` = md5( $password ) LIMIT 1;

That will return a true or false value based on the md5() hash of the
$password var. But you cannot reverse the md5 hash to obtain the
original value unless you perform a crack on it using software available
software. I think what you are looking for is the base64_encode() and
base64_decode() functions which will perform a simple encoding of data.

-- 
Jason Gerfen

I practice my religion
 while stepping on your
 toes...
~The Ditty Bops

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php