-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetUp.php
76 lines (64 loc) · 1.75 KB
/
setUp.php
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
include 'Crypt.php';
function writer($str, $file){
if(!file_exists($file)){
$h=fopen($file, 'a');
if($h){
fwrite($h, $str);
fclose($h);
}
}
}
$str='<?php
/**********************************************************************
* Crypt class *
* *
* Version: 1.0 *
* Date: 14-8-2020 *
* Author: Dan Machado *
* DO NOT modify this file. *
* If you want to change this file, deleted and change the values *
* if needed you can modify the values for the constants LT and SHIFT *
* in config.php *
**********************************************************************/
$POOL=array(';
for($i=0; $i<LT; $i++){
$str.="'". Crypt::random_str()."',";
}
$str=trim($str, ',') . ');';
$str."\n\n";
$str.='$keyring=array(';
$pool=json_decode(SED);
$i=0;
$str.='';
$l=count($pool);
while($l){
$i=mt_rand(0,$l-1);
$str.="'{$pool[$i]}'";
unset($pool[$i]);
$pool=array_values($pool);
$l=count($pool);
$str.='=>array(';
$j=0;
$pool2=json_decode(SED);
$l2=count($pool2);
while($l2){
$j=mt_rand(0,$l2-1);
$str.="'{$pool2[$j]}',";
unset($pool2[$j]);
$pool2=array_values($pool2);
$l2=count($pool2);
}
$str=trim($str, ',') . '),';
}
$str=trim($str, ',') . ");\n";
$str.='$shift_ky=array(';
for($i=0; $i<SHIFT; $i++){
$str.="'". Crypt::random_str()."',";
}
$str=trim($str, ',') . ');
';
$str.='$fuser=\''. Crypt::random_str().'\';
?>';
writer($str, PATH . '/' . KEY_FILE);
?>