Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function decrypt($pass) {
- $xarr = array (0x64, 0x73, 0x66, 0x64, 0x3b, 0x6b,
- 0x66, 0x6f, 0x41, 0x2c, 0x2e, 0x69,
- 0x79, 0x65, 0x77, 0x72, 0x6b, 0x6c,
- 0x64, 0x4a, 0x4b, 0x44, 0x48, 0x53,
- 0x55, 0x42);
- $z=0;
- $decrypted='';
- $unenc_lenght = (strlen($pass)-2)/2;
- $xorindex = (($pass[0]-0)*10)+($pass[1]-0);
- settype($xorindex, "integer");
- echo "Encrypted Password: <strong>".$pass."</strong><br />";
- for ($i = 2 ; $i <= strlen($pass); $i=$i+2) {
- $val=(hexdec($pass[$i])*16)+hexdec($pass[$i+1]);
- settype($val, "integer");
- $passdec[$z]=chr($val ^ $xarr[$xorindex]);
- $z++;
- $xorindex++;
- }
- for ($t=0;$t<=$unenc_lenght-1;$t++) {
- $decrypted .= $passdec[$t];
- }
- echo "Decrypted Password: <strong>".$decrypted." </strong>";
- return(1);
- }
- ?>
- <form action='<? $_SERVER['PHP_SELF']; ?>' method="post">
- <p>
- <input type="text" name="Password" size="40" />
- <input type="submit" name="Decrypt" value="Decrypt!" />
- </p>
- </form>
- <p>
- <?
- if ((isset($_POST[Decrypt])) and (strlen($_POST[Password])>0))
- decrypt($_POST[Password]);
- else
- echo " ";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement