Kryptering med PHP

Lite simpel kryptering för PHP

    define(‘SALT’, ‘din hemliga nyckel’);
    function encrypt($text)
        return trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, SALT, $text, MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND))));

    function decrypt($text)
        return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, SALT, base64_decode($text), MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND)));

How to install Lexmark X1270 under Linux

To get the Lexmark X1270 working under Linux you can use the drivers for the Lexmark Z600. (Only the printer will work, not the scanner) I had some problems to get it working at first, there was some libraries or whatever it was called that was missing so I added 3 files I needed in a archive for you to download.

But before you do that, add these PPA’s to the packet manager:
deb karmic main
deb-src karmic main

Inside the archive:

Just unpack it and doubleclick on the files to install them.

Download Lexmark x1270 Drivers for Linux here.