For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > July 2005 > Re: [PEAR] Crypt_Blowfish encryption between to servers fail









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PEAR] Crypt_Blowfish encryption between to servers fail
Matthew Fonda

2005-07-28, 5:01 pm

Thomas Nilsen wrote:

>Hope someone can shed some light on this issue.
>
>I want to encrypt data between two servers using cookies. I've been trying to use the Crypt Blowfish pear class, but I'm not able to decrypt data sent between the two servers.
>
>A simple script like this generates a base64 encoded string on server A:
>
>include 'Crypt/Blowfish.php';
>$ob = new Crypt_Blowfish('test');
>$o = ($ob->encrypt('blowfish'));
>print base64_encode($o);
>
>Then on server B, the following is executed:
>
>include 'Crypt/Blowfish.php';
>$ob = new Crypt_Blowfish('test');
>print $ob->decrypt(base64_decode(<output from $o on server A> ));
>
>But the output of the decrypted string is just gibberish. Also, comparing the plain output from the two servers when encrypting the same text using the same key, generates two completely different outputs.
>
>Is Blowfish not supposed to be transportable between two different systems? Seems a bit silly to only be able to decode the data on the same system it was encrypted...
>
>Server A is a Fedora #3 and Server B is a RedHat EL AS 3.0
>
>Regards,
>Thomas Nilsen
>
>Linux- The Ultimate Windows Service Pack
>
>
>
>
>

Nope, it should work between servers, output should be the same
regardless of what operating system you are on. If you could download
the Crypt_Blowfish version from CVS, and run the tests and send me the
results, as well as a phpinfo output from both servers, I will look into
fixing this.

Regards,
-- Matthew
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com