|
EN/DECRYPTIE functie's!
Auteur: Hendry - 06 februari 2005 - 22:42 - Gekeurd door: twopeak
- Hits: 2714 - Aantal punten:
0.67 (3 stemmen)
ik denk dat dit een heel handig en makkelijk scriptje is voor mensen die geen md5 gebruiken en/of het niet vertrouwen in de toekomst ofzo...
bij deze mijn EN/DECRYPTIE functie's script!
Citaat: Crew-edit: Dit script laten we staan om te tonen hoe moeilijk het is om een encriptie script te maken.
Dit script is echt niet veilig. Lees de commentaar ivm. waarom het niet te vertrouwen is.
|
| Code: |
<?php
// ENCRYPTIE FUNCTIE
function encrypt($password) {
$key = "ikbenhendryendezeencryptoriserggoednoujadathoopikteminstemorbitortororcitinciduntatporttitoreucongueaurnanullamtortorpedevolutpatsitametpharetraegetsuscipitidantesedtortormaurisfeugiataultricessedgravidanecdolor";
$crypt = "";
for($i=0;$i<strlen($password);$i++) {
$i_key = ord(substr($key, $i, 1));
$i_pass = ord(substr($password, $i, 1));
$n_key = ord(substr($key, $i+1, 1));
$i_crypt = $i_pass + $i_key;
$i_crypt = $i_crypt - $n_key;
if($i_crypt == 92) {
$i_crypt = 251;
}
$crypt .= chr($i_crypt);
}
return $crypt;
} //END encrypt() functie
// DECRYPTIE FUNCTIE
function decrypt($password) {
$key = "ikbenhendryendezeencryptoriserggoednoujadathoopikteminstemorbitortororcitinciduntatporttitoreucongueaurnanullamtortorpedevolutpatsitametpharetraegetsuscipitidantesedtortormaurisfeugiataultricessedgravidanecdolor";
$crypt = "";
$password = stripslashes($password);
for($i=0;$i<strlen($password);$i++) {
$i_key = ord(substr($key, $i, 1));
$i_pass = ord(substr($password, $i, 1));
if($i_pass == 251) {
$i_pass = 92;
}
$n_key = ord(substr($key, $i+1, 1));
$i_crypt = $i_pass + $n_key;
$i_crypt = $i_crypt - $i_key;
$crypt .= chr($i_crypt);
}
return $crypt;
} //EINDE decrypt() functie
echo encrypt("ditismijnwachtwoord");
// echo'ed: = brq`yp`t`puZrsb„oio
echo"<br><br>";
echo decrypt("brq`yp`t`puZrsb„oio");
// echo'ed: ditismijnwachtwoord
?>
<?php // ENCRYPTIE FUNCTIE function encrypt($password) { $key = "ikbenhendryendezeencryptoriserggoednoujadathoopikteminstemorbitortororcitinciduntatporttitoreucongueaurnanullamtortorpedevolutpatsitametpharetraegetsuscipitidantesedtortormaurisfeugiataultricessedgravidanecdolor"; $crypt = ""; for($i=0;$i<strlen($password);$i++) { $i_crypt = $i_pass + $i_key; $i_crypt = $i_crypt - $n_key; if($i_crypt == 92) { $i_crypt = 251; } } return $crypt; } //END encrypt() functie // DECRYPTIE FUNCTIE function decrypt($password) { $key = "ikbenhendryendezeencryptoriserggoednoujadathoopikteminstemorbitortororcitinciduntatporttitoreucongueaurnanullamtortorpedevolutpatsitametpharetraegetsuscipitidantesedtortormaurisfeugiataultricessedgravidanecdolor"; $crypt = ""; for($i=0;$i<strlen($password);$i++) { if($i_pass == 251) { $i_pass = 92; } $i_crypt = $i_pass + $n_key; $i_crypt = $i_crypt - $i_key; } return $crypt; } //EINDE decrypt() functie echo encrypt ("ditismijnwachtwoord"); // echo'ed: = brq`yp`t`puZrsb„oio echo decrypt ("brq`yp`t`puZrsb„oio"); // echo'ed: ditismijnwachtwoord ?>
Download code (.txt)
|
|
Stemmen |
| Niet ingelogd |
|