$b) { foreach($key as $c => $d) { if($d == $b) { $enstring .= chr($c); } } } return $enkey.$enstring; } } function decrypt($string) { if(is_string($string)) { for($i=0;$i<256;$i++) { $key[$i] = ord($string[$i]); } for($i=256;$i $b) { foreach($key as $c => $d) { if($b == $c) { $destring .= chr($d); } } } return $destring; } } } $string = "hello world"; $crypt = new crypt(); $encrypt = $crypt->encrypt($string); $decrypt = $crypt->decrypt($encrypt); print $encrypt; print "
"; print $decrypt; ?>