Bienvenido a Tecnohackers

Tecnohackers » Programacion » Programacion Webmaster (Moderador: Zentraedi)
 » 

[ PHP ] Encryption Assortment Kit - Version 1.28 - By Sneak



Autor Tema: [ PHP ] Encryption Assortment Kit - Version 1.28 - By Sneak  (Leído 908 veces)

Hwfr0ze

  • Visitante
[ PHP ] Encryption Assortment Kit - Version 1.28 - By Sneak
« en: Noviembre 23, 2009, 07:05:36 pm »
ASCII to Binary
Binary to ASCII
ASCII to Hex
Hex to ASCII
Binary to Hex
Hex to Binary
Backwards
Base 64 Encode
Base 64 Decode
Caesar Bruteforce
DES Crypt (one way)
HTML Entities Encode
HTML Entities Decode
l33t 5p34k 3nc0d3
l33t 5p34k d3c0d3
MD5 Crypt (one way)
Igpay Atinlay
Un-Pig Latin
ROT-13
URL Encode
URL Decode




Código: You are not allowed to view links. Register or Login
<?php

 
/***********************************************************************
 * sneak.php - v 1.27 - 2003/02/12
 *
 * SNEAK: Snarkles.Net Encryption Assortment Kit
 * =============================================
 * Send and decode messages using a number of different methods
 *
 * Please forward any suggestions, problems, improvements, etc. to the 
 * e-mail address below. Thanks! :D
 *
 * Copyright (c) 2000 - 2004 snarkles (webgeek@snarkles.net)
 * Distributed under the GNU/GPL license (see http://www.gnu.org/copyleft/)
 ************************************************************************/
 /************************************************************************
 * Changelog
 * =========
 * v 1.27 - 2004/10/28:
 * - Added zero padding to hex conversions < 10. Thanks to bubuche93 for
 *   the heads up.
 *
 * v 1.26 - 2003/06/20:
 * - Added function strip_spaces to remove spaces prior to trying to
 *   base64 decode a string. Thanks for Jeian and Goldfish for pointing
 *   this out.
 *   
 * v 1.25 - 2003/02/12:
 * - Fixed a bug in form that initially displayed an error about an 
 *   undefined variable in the textbox if error_reporting is set to max. 
 *   Thanks to Justin Hagstrom for notifying me of the problem. :)
 *
 * v 1.24 - 2003/02/01:
 * - D&#39;oh! Fixed a bug I introduced with the Caesar Bruteforce option that
 *   stuck that XSS vulnerability right back in there! :P
 *
 * v 1.23 - 2003/01/27:
 * - Added "Caesar Bruteforce" option which will attempt all 26 
 *   possible shifts of a Caesar (rotation) cipher.
 *
 * v 1.22 - 2003/01/26:
 * - Textbox now retains original text value, so you can try different 
 *   encryption methods on the same text without copying/pasting
 *   Thanks to barnseyboy who suggested the feature. :)
 *
 * v 1.21 - 2003/01/14:
 * - Fixed XSS vulnerability that could potentially allow people to steal
 *   cookies from sites with the script installed.
 *   Credit for spotting this vulnerability goes to JeiAr from
 *   CyberArmy Security Research (http://www.security-research.org/)
 *
 * v 1.20 - 2002/08/10:
 * - Added HTML entity encode/decode option
 * - Changed order of listings so encoding is always before decoding
 * - Fixed problem that caused special characters to be lost when 
 *   writing back to the screen
 *
 * v 1.11 - 2002/02/21:
 * - Cleaned up code some--now all chunk_splitting and str_replacing is 
 *   done within the functions, rather than during the switch statement
 * - Specified CRYPT_STD_DES in crypt() function, to fix problem with PHP 4.1.2
 *
 * v 1.10 - 2002/02/17:
 * - Added bin2hex, hex2bin, and pig latin functions
 *
 * v 1.00 - 2002/02/15:
 * - Nothing yet, but I&#39;m sure that&#39;ll CHANGE. Ha! Get it? ;)
 *************************************************************************/
  
$version "1.27";

  
// You can alter the HTML below to make this script fit more inline with 
  // the rest of your site.

?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
 <head>
  <title>SNEAK: Snarkles.Net Encryption Assortment Kit</title>
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
  <style type="text/css">
  <!--
    body { font-family: "arial", "helvetica", sans-serif; font-size: 10pt; }
  -->
  </style>
 </head>
 <body>

<?php

  
// Declare some functions for encryption not included in PHP

    
function asc2bin($str) {
      
$text_array explode("\r\n"chunk_split($str1));
      for (
$n 0$n count($text_array) - 1$n++) {
        
$newstring .= substr("0000".base_convert(ord($text_array[$n]), 102), -8);
      }
      
$newstring chunk_split($newstring8" ");
      return 
$newstring;
    }

    function 
bin2asc($str) {
      
$str str_replace(" """$str);
      
$text_array explode("\r\n"chunk_split($str8));
      for (
$n 0$n count($text_array) - 1$n++) {
        
$newstring .= chr(base_convert($text_array[$n], 210));
      }
      return 
$newstring;
    }

    
// Made this alias because "bin2hex" would be confusing in the context of this script :P
    
function asc2hex($str) {
      return 
chunk_split(bin2hex($str), 2" ");
    }

    function 
hex2asc($str) {
      
$str str_replace(" """$str);
      for (
$n=0$n<strlen($str); $n+=2) {
        
$newstring .=  pack("C"hexdec(substr($str$n2)));
      }
      return 
$newstring;
    }

    function 
binary2hex($str) {
      
$str str_replace(" """$str);
      
$text_array explode("\r\n"chunk_split($str8));
      for (
$n 0$n count($text_array) - 1$n++) {
        
$newstring .= str_pad(base_convert($text_array[$n], 216), 2"0"STR_PAD_LEFT);
      }
      
$newstring chunk_split($newstring2" ");
      return 
$newstring;
    }

    function 
hex2binary($str) {
      
$str str_replace(" """$str);
      
$text_array explode("\r\n"chunk_split($str2));
      for (
$n 0$n count($text_array) - 1$n++) {
        
$newstring .= substr("0000".base_convert($text_array[$n], 162), -8);
      }
      
$newstring chunk_split($newstring8" ");
      return 
$newstring;
    }

    function 
caesarbf($str) {
  $alpha = &#39;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ&#39;;
  echo "<table width=\"85%\" cellpadding=\"2\" align=\"center\">\n";
  for ($n 1$n 26$n++) {
    $cipher substr($alpha$n26 $n) . substr($alpha0$n) . substr($alpha26+$n52-$n) . substr($alpha26$n);
if ($n == 0) {
  echo &#39;<tr bgcolor="#eeeeee">&#39;;
} else {
  echo &#39;<tr bgcolor="#cccccc">&#39;;
}
echo "<td>ROT-$n: "strtr($str$alpha$cipher) ."</td>";
  }
  echo "<tr>\n";
  echo "</table>\n";
}

    function 
entityenc($str) {
      
$text_array explode("\r\n"chunk_split($str1));
      for (
$n 0$n count($text_array) - 1$n++) {
        
$newstring .= "&#38;#" ord($text_array[$n]) . ";";
      }
      return 
$newstring;
    }

    function 
entitydec($str) {
      
$str str_replace(&#39;;&#39;, &#39;; &#39;, $str);
      
$text_array explode(&#39; &#39;, $str);
      
for ($n 0$n count($text_array) - 1$n++) {
        
$newstring .= chr(substr($text_array[$n], 23));
      }
      return 
$newstring;
    }

    function 
l33t($str) {
      
$from = &#39;ieastoIEASTO&#39;;
      
$to = &#39;134570134570&#39;;
      
$newstring strtr($str$from$to);
      return 
$newstring;
    }

    function 
del33t($str) {
      
$from = &#39;134570&#39;;
      
$to = &#39;ieasto&#39;;
      
$newstring strtr($str$from$to);
      return 
$newstring;
    }

    function 
igpay($str) {
      
$text_array explode(" "$str);
      for (
$n 0$n count($text_array); $n++) {
        
$newstring .= substr($text_array[$n], 1) . substr($text_array[$n], 01) . "ay ";
      }
      return 
$newstring;
    }

    function 
unigpay($str) {
      
$text_array explode(" "$str);
      for (
$n 0$n count($text_array); $n++) {
        
$newstring .= substr($text_array[$n], -31) . substr($text_array[$n], 0strlen($text_array[$n]) - 3) . " ";
      }
      return 
$newstring;
    }

    function 
rot13($str) {
      
$from = &#39;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ&#39;;
      
$to   = &#39;nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM&#39;;
      
$newstring strtr($str$from$to);
      return 
$newstring;
    }

    function 
strip_spaces($str) {
      
$str str_replace(" """$str);
      return 
$str;
    }

  
// Check to see if form has been submitted yet
  
if(isset($_POST[&#39;submit&#39;])) {

    // Yes, so make sure they filled something in
    
$text $_POST[&#39;text&#39;];

    
if($text == &#39;&#39;) {
      
die("<p>Fill in the form, dinglefritz! ;)</p>\n");
    }

    
// Looks good, so clean up data
    
$text urldecode(stripslashes($text));

    
// Make copy of original text for later display
    
$orig_text $text;
    
$orig_text htmlentities($orig_text);
    echo(
"<p>$orig_text converts to:</p>\n");

    
// De/Encrypt based on selection in form
    
switch ($_POST[&#39;cryptmethod&#39;]) {
     
case "asc2bin":
       
$text asc2bin($text);
       break;
     case 
"asc2hex":
       
$text asc2hex($text);
       break;
     case 
"bin2asc":
       
$text bin2asc($text);
       break;
     case 
"hex2asc":
       
$text hex2asc($text);
       break;
     case 
"bin2hex":
       
$text binary2hex($text);
       break;
     case 
"hex2bin":
       
$text hex2binary($text);
       break;
     case 
"backwards":
       
$text strrev($text);
       break;
     case &
#39;b64enc&#39;:
       
$text base64_encode($text);
       break;
     case &
#39;b64dec&#39;:
       
$text base64_decode(strip_spaces($text));
       break;
 case &#39;caesarbf&#39;:
   $text caesarbf($text);
   break;
     case &
#39;crypt&#39;:
       
$text crypt($text, &#39;CRYPT_STD_DES&#39;);
       
break;
     case &
#39;entityenc&#39;:
       
$text entityenc($text);
       break;
     case &
#39;entitydec&#39;:
       
$text entitydec($text);
       break;
     case 
"l33t":
       
$text l33t($text);
       break;
     case 
"del33t":
       
$text del33t($text);
       break;
     case &
#39;md5&#39;:
       
$text md5($text);
       break;
     case &
#39;igpay&#39;:
       
$text igpay($text);
       break;
     case &
#39;unigpay&#39;:
       
$text unigpay($text);
       break;
     case 
"rot-13":
       
$text rot13($text);
       break;
     case &
#39;urlenc&#39;:
       
$text urlencode($text);
       break;
     case &
#39;urldec&#39;:
       
$text urldecode($text);
       break;
     default:
       die(
"<p>That encryption type is not supported.</p>\n");
    } 
// end switch

  // Convert to HTML entities so special chars show up
  
$text htmlentities($text);

  
// Display result to the screen
  
echo("<p>$text</p>\n");

  } 
// end if

?>


 <!-- begin form -->
 <center>
  <form action="<?php echo($_SERVER[&#39;PHP_SELF&#39;]); ?>" method="post">
   <textarea name="text" rows="5" cols="50"><?php if (isset($orig_text)) { echo($orig_text); } ?></textarea><br />
   <select name="cryptmethod">
    <option value="asc2bin">ASCII to Binary</option>
    <option value="bin2asc">Binary to ASCII</option>
    <option value="asc2hex">ASCII to Hex</option>
    <option value="hex2asc">Hex to ASCII</option>
    <option value="bin2hex">Binary to Hex</option>
    <option value="hex2bin">Hex to Binary</option>
    <option value="backwards">Backwards</option>
    <option value="b64enc">Base 64 Encode</option>
    <option value="b64dec">Base 64 Decode</option>
<option value="caesarbf">Caesar Bruteforce</option>
    <option value="crypt">DES Crypt (one way)</option>
    <option value="entityenc">HTML Entities Encode</option>
    <option value="entitydec">HTML Entities Decode</option>
    <option value="l33t">l33t 5p34k 3nc0d3</option>
    <option value="del33t">l33t 5p34k d3c0d3</option>
    <option value="md5">MD5 Crypt (one way)</option>
    <option value="igpay">Igpay Atinlay</option>
    <option value="unigpay">Un-Pig Latin</option>
    <option value="rot-13">ROT-13</option>
    <option value="urlenc">URL Encode</option>
    <option value="urldec">URL Decode</option>
   </select><br />
   <input type="submit" name="submit" value="OK" />
   <input type="reset" value="Clear" />
  </form>
 </center>
 <!-- end form -->

 <!-- begin footer; it would be nice if you would leave this on. ;) -->
 <center>
  <p>
     <font size="1">Fine Print Shtuff:<br />
     SNEAK: Snarkles.Net Encryption Assortment Kit - Version <?php echo($version); ?><br />
     &copy; 2000, 2001, 2002, 2003 <a href="http://snarkles.net">snarkles</a><br />
     Download a copy <a href="http://snarkles.net/scripts/sneak/sneak-<?php echo($version); ?>.zip">here</a></font>
  </p>
 </center>
 <!-- end footer -->

 </body>
</html>


Saludos
« Última modificación: Noviembre 23, 2009, 08:23:54 pm por Hwfr0ze »

Tags:
Tags:

 


SMF 2.0.19 | SMF © 2016, Simple Machines
Paginas Afiliadas
Twitter - FaceBook - Daraxblog
Designed by Smf Personal