Source for file Encryption.php

Documentation is available at Encryption.php

  1. <?php
  2. /**
  3.  *    LAIKA FRAMEWORK Release Notes:
  4.  *
  5.  *    @filesource     Encryption.php
  6.  *
  7.  *    @version        0.1.0b
  8.  *    @package        Laika
  9.  *    @subpackage     util
  10.  *    @category       data
  11.  *    @date           2012-05-18 22:08:04 -0400 (Fri, 18 May 2012)
  12.  *
  13.  *    @author         Leonard M. Witzel <witzel@post.harvard.edu>
  14.  *    @copyright      Copyright (c) 2012  Laika Soft <{@link http://oafbot.com}>
  15.  *
  16.  */
  17. /**
  18.  * Laika_Encryption class.
  19.  * 
  20.  * @extends Laika
  21.  */
  22. class Laika_Encryption extends Laika{
  23.     
  24.     
  25. //-------------------------------------------------------------------
  26. //    METHODS
  27. //-------------------------------------------------------------------    
  28.  
  29.     public static function encrypt($key,$string){
  30.         return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256md5($key)$stringMCRYPT_MODE_CBCmd5(md5($key))));
  31.     }
  32.     
  33.     public static function decrypt($key,$encrpted){
  34.         return rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256md5($key)base64_decode($encrypted)MCRYPT_MODE_CBCmd5(md5($key)))"\0");
  35.     }
  36.     
  37. }

Documentation generated on Sat, 19 May 2012 02:16:59 -0400 by phpDocumentor 1.4.4