Public paste
Undefined
By: fruffl | Date: Dec 12 2009 23:13 | Format: None | Expires: never | Size: 996 B | Hits: 893

  1. public function
  2.       dlcrypt
  3.       ($s = null, $e = "dl01", $ok = true)
  4.       {
  5.  
  6.  
  7.               if (empty($s) || !$ok) return;
  8.  
  9.               $p = 0;
  10.  
  11.               for ($i = 0; $i < strlen($s); $i++) {
  12.  
  13.                 $c = ord($s[$i]);
  14.  
  15.  
  16.  
  17.                 switch ($e)
  18.                 {
  19.                   case "dl01":
  20.                     if($c < 128) $c = $c ^ 2;
  21.                     break;
  22.                   case "dl02":
  23.                     if($c < 128) $c = $c ^ (($p++ % 8) + 1);
  24.                     break;
  25.                   case "dl03":
  26.                     if($c < 128) $c = $c ^ (($p++ % 8) + 1 ^ 64);
  27.                     break;
  28.                 }
  29.  
  30.  
  31.                 $o = $o.chr($c);
  32.  
  33.                 if(strlen($o) > 80)
  34.                 {
  35.                   $ar[$ic++] = $o;
  36.                   $o = null;
  37.                 }
  38.  
  39.               }
  40.  
  41.               if(isset($ar) && is_array($ar)) foreach($ar as $v) $o .= $v;
  42.  
  43.               return $o;
  44.  
  45.       }