initial commit

This commit is contained in:
root
2024-06-03 16:43:53 +03:00
commit 21e3fd0797
1535 changed files with 60499 additions and 0 deletions

1
junet/html/cleaner.sh Normal file
View File

@@ -0,0 +1 @@
rm *~ .*

View File

@@ -0,0 +1,25 @@
<?php
function decrypt_password($sz_pwd,$password){
$en_pwd = substr($password,0,$sz_pwd);
$key = substr($password,$sz_pwd);
$key_arr = array();
for( $i = 0 ; $i < $sz_pwd ; $i++ ){
$key_arr[$i] = ord($key[$i]) - 33;
}
$dcpt_pwd = new SplFixedArray($sz_pwd);
for( $i = 0 ; $i < $sz_pwd ; $i++ ){
$dcpt_pwd[$key_arr[$i]] = $en_pwd[$i];
}
$decrypt_password = '';
for( $i = 0 ; $i < $sz_pwd ; $i++ ){
$decrypt_password .= $dcpt_pwd[$i];
}
return $decrypt_password;
}
?>

View File

@@ -0,0 +1,23 @@
<?php
function encrypt_password($password){
$encrypt_psswd = '';
$encrypt_idcs = '';
$sz = strlen($password);
$idx;
$set = new \Ds\Set();
for( $i = 0 ; $i < $sz ; $i++ ){
$idx = rand(0,$sz-1);
while( $set->contains($idx) ){
$idx = rand(0,$sz-1);
}
$encrypt_psswd .= $password[$idx];
$set->add($idx);
$encrypt_idcs .= chr($idx+33);
}
$encrypt_psswd .= $encrypt_idcs;
return $encrypt_psswd;
}
?>

View File

@@ -0,0 +1,7 @@
<?php
function gen_hash($password){
$h_value = hash('xxh128',$password);
return $h_value;
}
?>

14
junet/html/index.php Normal file
View File

@@ -0,0 +1,14 @@
<?php
include 'encrypt_password.inc.php';
include 'hash_gen.inc.php';
include 'decrypt_password.inc.php';
$password = $_REQUEST['password'];
$en_pwd = encrypt_password($password);
echo "Given Passowrd: ".$password."<br>";
echo "Encrypted Password for database: ".$en_pwd." <br>";
echo "Hash value of given password: ".gen_hash($password)."<br>";
echo "Decrypted Password from the database: ".decrypt_password(strlen($password),$en_pwd);
?>

View File

@@ -0,0 +1,10 @@
<form action="index.php" method="post">
<div>
<label for="password">
Password : <input type="text" name="password" id="password"/>
</label>
</div>
<div>
<input type="submit" value="GO"/>
</div>
</form>