Kryptering med PHP

Lite simpel kryptering för PHP

<?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 http://ppa.launchpad.net/jason-scheunemann/ppa/ubuntu karmic main
deb-src http://ppa.launchpad.net/jason-scheunemann/ppa/ubuntu karmic main

Inside the archive:
z600cups_1.0-2_i386-3.deb
z600llpddk_2.0-2_i386.deb
libcupsys2_1.3.9-17ubuntu3.4_all.deb

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

Download Lexmark x1270 Drivers for Linux here.