Re: DES Encryption Java for the Basic authentication PHP
Johnny wrote:
On Nov 3, 1:17 am, Arne VajhHj <a...@vajhoej.dk> wrote:
Johnny wrote:
I need an algorithm to encrypt a string with the DES encryption, that
works whit the basic auth in PHP.
I've tried some algorithms but the output don't works whit php....
BASIC Authentication does not use DES.
It uses a simple Bse64 encoding of username:password !
Arne
So, why here http://it2.php.net/crypt tell me that function crypt()
uses a standard DES encryption...
I need an algorithm to produce an encryption like this
lrB4D/h6wbVTM
to have this output i called this function
crypt("ciao","lr");
If you need the crypt functionality in Java then look at:
http://www.dynamic.net.au/christos/crypt/
crypt do use DES, but are not a simple DES.
http://en.wikipedia.org/wiki/Crypt_%28Unix%29
says:
#The traditional implementation uses a modified form of the DES
#algorithm. The user's password is truncated to eight characters, and
#those are coerced down to only 7-bits each; this forms the 56-bit DES
#key. That key is then used to encrypt an all-bits-zero block, and then
#the ciphertext is encrypted again with the same key, and so on for a
#total of 25 DES encryptions. A 12-bit salt is used to perturb the
#encryption algorithm, so standard DES implementations can't be used to
#implement crypt(). The salt and the final ciphertext are encoded into a
#printable string in a form of base 64.
Arne