Ladderwagen - 2002-09-20

Machines tested on:
* RedHat 7.2 / Apache 1.3.22-6 / PHP 4.1.2 / no extra modules loaded for testing purposes / all installed through RPM
* same machine, but downgraded to PHP 4.0.6 through RPM
* Debian testing/Sarge / Apache 1.3.24 / PHP 4.2.1 / mod_xalan / all installed through apt-get

Downloaded .97 and followed the steps in de README (both encoder en decoder), but I still can't get it working.
For the encoder:
* I edited ../common/customize.h and entered my own prefix
* typed "make" in the encoder directory, waited a little and found a new "encoder", "purify" and "url_encode" in the ../bin directory; all perfectly startable

For the decoder:
* Downloaded the appropriate PHP-sources (4.1.2 for RedHat versus 4.2.1 for the Debian-box), and extracted them (in /tmp)
* "cd /tmp/php-4.2.1"; "ln -s /tmp/microcode/decoder ext/microcode" (symbolic link worked)
* left the same prefix as for the encoder in customize.h (as it was an symbolic link to ../common/customize.h)
* in /tmp/php-4.2.1 I did an "rm configure" and a "./buildconf"
* just to make sure I cd't into ext/microcode and did a "make clean"
* typed "./configure --with-microcode=shared --with-apxs=/usr/bin/apxs"
* "make" (and all other actions) didn't return any failures and quited happily after hard work
* in the /tmp/php-4.2.1/modules directory I found the "microcode.so" (and off course I was reluctant!)
* copied this .so to my php's extension-dir (/usr/lib/php4 for RedHat versus /usr/lib/php4/apache for my Debian)
* added in my php.ini the line "extension=microcode.so" and restarted Apache (with no errors whatsoever)

On both systems, phpinfo() perfectly shows the loaded module, and the Apache error.log shows no errors:
microcode
Databay AG Encryption Support enabled
Copyright Notice (C) 2001-2002 by Databay AG
Version V 0.97
Directive          Local Value                Master Value
enable_keyfile  0                               0
keyfile             /etc/microcode/default.key /etc/microcode/default.key

I have to notice that I tested this seperately: a complete run (ok, multiple ;-) ) on the RedHat-box with the two versions of PHP, when that didn't work I tried the Debian-box. Just for overview-purposes I made a shorter abstract

I made an test.php in my webroot with the following contents:
============== test.php ================
<?php
echo time();
?>
============== test.php ================

I did an /tmp/microcode/bin/purify test.php test-pure.php and that gave me:

============== test-pure.php ================
echo time();
;
============== test-pure.php ================
(perfectly logical to me, except for the second semicolon :-/ ; removing it didn't make any difference: it still wouldn't decode)

Now the weirdest part:
I did an /tmp/microcode/bin/encoder test-pure.php test-pure-enc.php 31
(which should encode test-pure.php into test-pure-enc.php with the Rijndael-128 algorithm)
and ended up with:
============== test-pure-enc.php ================
tN] +:Ua@b{Fc 3cSGa--

w31
============== test-pure-enc.php ================

Great! I thought; perfectly unreadable, let's test!

I fired up a browser and typed "http://192.168.0.17/test.php" (not local, but it's my newly set up testserver): worked.
With "http://192.168.0.17/test-pure.php" I ended up with "the source" -> OK, perfectly logical because of no "<?php ?>"-stuff
When I try to do a "http://192.168.0.17/test-pure-enc.php" in the browser, I expected to see a timestamp (the encoded "test.php"). What I saw was the exact garbage as a "cat test-pure-enc.php" would give: it wasn't decoded, let alone parsed or fed to the php-engine.

The problem: obviously it doesn't work for me. Because I can't imagine this program is rubbish (because of all the praising comments and stuff), I'm very interested in the thing I'm doing wrong (everything points in that direction, I have heard of working examples).

Hope you didn't get afraid of the huge amount of text I wrote. If needed, I'll write more ;-)

Thumbs up!