Archive for December, 2007

ROT13 transform

Sunday, December 9th, 2007

Simple example of the ROT13 algorithm. ROT13 is a simple function which rotates the
characters of a string 13 places forward.

Hint:
Since PHP 4+ you can use the PHP build-in function str_rot13.
This is just a example implementation to show how it works.

Posted in Uncategorized | Comments Off on ROT13 transform

Delete temporary files

Sunday, December 9th, 2007

This example shows how to delete specific files
after a given time span.
This works good for cleaning cached files.

Posted in Uncategorized | Comments Off on Delete temporary files

MD5-based block cipher

Saturday, December 8th, 2007

Below is a MD5-based block cipher (MDC-like), which works in 128bit CFB mode.
It is very useful to encrypt secret data before transfer it over the network.

Posted in Uncategorized | Comments Off on MD5-based block cipher

Format string as machine compatible key

Saturday, December 8th, 2007

This snippet converts a “dirty” string that may contain special characters into a machine compatible nice looking string.

That function works fine for creating urls or ID keys.

Posted in Uncategorized | Comments Off on Format string as machine compatible key