Re: (S.O.S) Only 4 the best programmers. About Javascript & PHP

From: Shawn Wilson (shawn_at_glassgiant.com)
Date: 02/23/04


Date: Mon, 23 Feb 2004 14:07:27 -0400

Amilcar wrote:
>
> I've a page that sends an encrypted password, using MD5, to a PHP
> file, which is able to compare such MD5 encrypted password with an
> encryption stored on a data base. But the encryption way, on mD5, on
> JavaScript and PHP doesn't return the same value.
> My questions are:
> 1. Aren't these methods the same? I mean, the implementation on
> JavaScript and the implementation on PHP.
>
> 2. I could fix this by calling my .js file on my .php file. How can I
> do this?
>
> 3. Does anyone know about an encryption method that return the same
> value, on JavaScript and PHP?

Yeah, ego thing aside, I just tested a Javascript (IE6/Win98) md5 hash and a PHP
one. They both came out the same (though it's quite possible different browsers
will implement it differently). Before you think too hard about solutions, I'd
make sure you're using the same text for both. Make sure something stupid is
not going on, like unintentional backslashes in the text or sending "Array()"
instead of an array element or any of the common errors that you might be
overlooking.

Once you figure out what's wrong and how to fix it, you might want to reconsider
using Javascript :o)

Shawn

-- 
Shawn Wilson
shawn@glassgiant.com
http://www.glassgiant.com


Relevant Pages

  • (S.O.S) Only 4 the best programmers. About Javascript & PHP
    ... I've a page that sends an encrypted password, using MD5, to a PHP ... But the encryption way, on mD5, on ...
    (comp.lang.php)
  • Re: (S.O.S) Only 4 the best programmers. About Javascript & PHP
    ... > I've a page that sends an encrypted password, using MD5, to a PHP ... > encryption stored on a data base. ... > JavaScript and PHP doesn't return the same value. ...
    (comp.lang.php)
  • Re: (S.O.S) Only 4 the best programmers. About Javascript & PHP
    ... > I've a page that sends an encrypted password, using MD5, to a PHP ... > JavaScript and PHP doesn't return the same value. ...
    (comp.lang.php)
  • Re: MD5 Encryption
    ... > I have a web site that allows users to change their passwords, ... encrypted through PHP using MD5. ... using the same encryption that PHP & the web site are using to ...
    (microsoft.public.fox.helpwanted)
  • MD5 Encryption
    ... I have a web site that allows users to change their passwords, which are encrypted through PHP using MD5. ... Does anyone know how I can us VFP to put in a default password for the user, using the same encryption that PHP & the web site are using to validate the password when the user logs in? ...
    (microsoft.public.fox.helpwanted)