-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathzcrypt.php
More file actions
40 lines (36 loc) · 870 Bytes
/
zcrypt.php
File metadata and controls
40 lines (36 loc) · 870 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
function zCrypt($string){
$alfabeto = 256;
$tamanho = 4;
$fora = 32;
$crypt = '';
$decrypt = '';
for($i = 0; $i < strlen($string); $i++){
$cod = ord($string[$i]);
$novocod = $cod + $tamanho;
$novocod = $novocod % $alfabeto;
if($novocod >= 0 && $novocod < $fora){
$crypt += $fora;
}
$crypt .= chr($novocod);
}
echo "iTmZxB0T ~> Crypt Hash: ". $crypt . "</br>";
}
function zDecrypt($hash){
$alfabeto = 256;
$tamanho = 4;
$fora = 32;
$crypt = '';
$decrypt = '';
for($i = 0; $i < strlen($hash); $i++){
$key = ord($hash[$i]);
$novoCod = $key - $tamanho;
if($novoCod >= 0 && $novoCod < $fora){
$decrypt -= $fora;
}
if($novoCod < 0){
$novoCod = $alfabeto + $novoCod;
}
$decrypt .= chr($novoCod);
}
echo "iTmZxB0T ~> Decrypt Hash: ".$decrypt."</br>";
}