Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function encript($pass)
- {
- $output =[];
- $string = $pass;
- $panjang_karakter = strlen($string);
- for ($i=0; $i < $panjang_karakter ; $i++) {
- $enkrip = substr($string,$i ,1);
- $enkrip = unpack("C*", $enkrip);
- $enkrip = ($enkrip[1] + 20) - 24;
- $enkrip = chr($enkrip);
- array_push($output, $enkrip);
- }
- return implode($output);
- }
- public function decript($pass)
- {
- $output =[];
- $string = $pass;
- $panjang_karakter = strlen($string);
- for ($i=0; $i < $panjang_karakter ; $i++) {
- $enkrip = substr($string,$i ,1);
- $enkrip = unpack("C*", $enkrip);
- $enkrip = ($enkrip[1] - 20) + 24;
- $enkrip = chr($enkrip);
- array_push($output, $enkrip);
- }
- return implode($output);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement