<?
 //*********************************************************//
 //*    Reservados todos los derechos HACKPRO TM © 2005    *//
 //*-------------------------------------------------------*//
 //* Ejemplo de como utilizar la Clase EnDecryptText.      *//
 //*.......................................................*//
 //* Encrypts and Decrypts a chain.                        *//
 //*-------------------------------------------------------*//
 //* Original in VB for:    Kelvin C. Perez.               *//
 //* E-Mail:                kelvin_perez@msn.com           *//
 //* WebSite:               http://home.coqui.net/punisher *//
 //*+++++++++++++++++++++++++++++++++++++++++++++++++++++++*//
 //* Programmed in PHP for: Heriberto Mantilla Santamaría. *//
 //* E-Mail:                heri_05-hms@mixmail.com        *//
 //* WebSite:               www.geocities.com/hackprotm/   *//
 //*.......................................................*//
 //* Example how to uses this class EnDecryptText.         *//
 //*-------------------------------------------------------*//
 //*         All Rights Reserved HACKPRO TM © 2005         *//
 //*********************************************************//
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
 <HEAD>
  <META HTTP-EQUIV = "content-type" CONTENT = "text/html; charset=us-ascii">
  <META HTTP-EQUIV = "imagetoolbar" CONTENT = "no">
  <META NAME = "author" CONTENT = "Heriberto Mantilla Santamaría">
  <TITLE>.: PHP Encrypt/Decrypt Text :.</TITLE>
  <SCRIPT TYPE = "Text/JavaScript">
   /***********************************************************************
    * Disable select-text script- © Dynamic Drive (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit http://www.dynamicdrive.com/ for full source code
    ***********************************************************************/

    //form tags to omit in NS6+:
    var omitformtags = ["INPUT", "TEXTAREA", "SELECT"]
    omitformtags = omitformtags.join("|")

    function disableselect(e)
    {if (omitformtags.indexOf(e.target.tagName.toLowerCase()) == -1)
     return false
    }

    function reEnable()
    {return true}

    if (typeof document.onselectstart != "undefined")
     document.onselectstart = new Function ("return false")
    else
    {document.onmousedown = disableselect
     document.onmouseup = reEnable
    }
  </SCRIPT>
 </HEAD>
 <LINK HREF = "..\Styles\Style.css" REL = "STYLESHEET" TYPE = "TEXT/CSS">
 <BODY BGCOLOR = "white">
  <!-- Empieza Sección STYLE-->
  <STYLE TYPE = "TEXT/CSS" REL = "STYLESHEET">
   BODY            {scrollbar-arrow-color:#666699; scrollbar-highlight-color:#FFFFFF; scrollbar-face-color:#ECF0F5; scrollbar-3dlight-color:#E0E0E0; scrollbar-track-color:#E2E5E9; scrollbar-darkshadow-color:#9C9ACE; scrollbar-shadow-color:#9C9ACE;}
   A.TABLA:LINK    {COLOR: "RGB(45, 89, 164)"; TEXT-DECORATION: "NONE"}
   A.TABLA:VISITED {COLOR: "RGB(45, 89, 164)"; TEXT-DECORATION: "NONE"}
   A.TABLA:ACTIVE  {COLOR: "RGB(45, 89, 164)"; TEXT-DECORATION: "NONE"}
   A.TABLA:HOVER   {COLOR: "RGB(0, 63, 147)"; TEXT-DECORATION: "NONE"}
  </STYLE> <!-- Términa Sección STYLE-->
  <SCRIPT LANGUAGE = "JavaScript">
   <!--
   var ns4up = (document.layers) ? 1 : 0;
   var ie4up = (document.all) ? 1 : 0;
   function HOffset()
   {var window_WIDTH = window.innerWidth ? window.innerWidth : (document.body.clientWidth ? document.body.clientWidth : 0);
    return Math.max( 0, Math.floor( (window_WIDTH - 694) / 2 ) - 90 ).toString();
   }
   document.write( "<DIV ID = 'IDAlignPage' style='POSITION:ABSOLUTE;TOP:0px;LEFT:" + HOffset() + "px;'>&nbsp;" );
   function DoReposition()
   {var o = 'IDAlignPage';
    if(document.getElementById(o)){
     var e = document.getElementById(o);
     e.style.LEFT = HOffset() + 'px';
    }
    else if(ie4up){
     var e = eval('document.all.' + o);
     e.style.LEFT = HOffset() + 'px';
    }
    else if (ns4up){
     var e = eval('document.' + o);
     e.LEFT = HOffset();
    }
   }
   window.onresize=DoReposition;
   window.onload=DoReposition;
   //-->
  </SCRIPT>
  <?
  echo '<DIV STYLE = "position:absolute; left:670px; top:48px; z-index:3">';
  echo '<A HREF = "http://www.pscode.com/vb/scripts/ShowCode.asp?txtCodeId=1760&lngWId=8"><IMG BORDER = "0" SRC = "../images/PscContestWinner_short.gif"></A>';
  echo '</DIV>';
  echo '<DIV STYLE = "position:absolute; overflow:hidden; left:204px; top:0px; width:28px; height:47px; z-index:1">';
  echo ' <IMG WIDTH = "28" HEIGHT = "47" BORDER = "0" SRC = "../images/topmenu_img1.gif">';
  echo '</DIV>';
  echo '<DIV STYLE = "position:absolute; overflow:hidden; left:0px; top:47px; width:205px; height:85px; z-index:1">';
  echo ' <IMG WIDTH = "205" HEIGHT = "85" BORDER = "0" SRC = "../images/users_feedback_bg.gif">';
  echo '</DIV>';
  echo ' <DIV STYLE = "position:absolute; overflow:hidden; left:0px; top:0px; width:205px; height:47px; z-index:1">';
  echo ' <IMG WIDTH = "205" HEIGHT = "47" BORDER = "0" SRC = "../images/users_feedback_s.gif">';
  echo '</DIV>';
  echo '<DIV STYLE = "position:absolute; overflow:hidden; left:230px; top:360px; width:548px; height:47px; z-index:1">';
  echo ' <IMG WIDTH = "548" HEIGHT = "47" BORDER = "0" SRC = "../images/botmenu_bg.gif">';
  echo '</DIV>';
  echo '<DIV STYLE = "position:absolute; overflow:hidden; left:0px; top:360px; width:203px; height:47px; z-index:1">';
  echo ' <IMG WIDTH = "203" HEIGHT = "47" BORDER = "0" SRC = "../images/bot1.gif">';
  echo '</DIV>';
  echo '<DIV STYLE = "position:absolute; overflow:hidden; left:203px; top:360px; width:28px; height:47px; z-index:1">';
  echo ' <IMG WIDTH = "28" HEIGHT = "47" BORDER = "0" SRC = "../images/bot2.gif">';
  echo '</DIV>';
  echo '<DIV STYLE = "position:absolute; overflow:hidden; left:231px; top:0px; width:548px; height:47px; z-index:1">';
  echo ' <IMG WIDTH = "548" HEIGHT = "47" BORDER = "0" SRC = "../images/products_b.gif">';
  echo '</DIV>';
  echo '<DIV STYLE = "position:absolute; overflow:hidden; left:0px; top:64px; width:205px; height:253px; z-index:1">';
  echo ' <IMG WIDTH = "205" HEIGHT = "253" BORDER = "0" SRC = "../images/new_releases_bg.gif">';
  echo '</DIV>';
  echo '<DIV STYLE = "position:absolute; overflow:hidden; left:0px; top:210px; width:206px; height:25px; z-index:1">';
  echo ' <IMG WIDTH = "206" HEIGHT = "25" BORDER = "0" SRC = "../images/borde1.gif">';
  echo '</DIV>';
  echo '<DIV STYLE = "position:absolute; overflow:hidden; left:0px; top:410px; width:779px; height:15px; z-index:1; background-color:#9DA7BD"></DIV>';
  echo '<DIV STYLE = "position:absolute; overflow:hidden; left:5px; top:15px; width:166px; height:17px; z-index:1">';
  echo ' <DIV ALIGN = "center">';
  echo '  <FONT STYLE = "font-size:9pt" COLOR = "#666699" FACE = "Tahoma">';
  echo '   <B>Description</B>';
  echo '  </FONT>';
  echo ' </DIV>';
  echo '</DIV>';
  echo '<DIV STYLE = "position:absolute; overflow:hidden; left:510px; top:407px; width:260px; height:18px; z-index:1">';
  echo ' <DIV>';
  echo '  <FONT STYLE = "font-size:8pt" COLOR = "black" FACE = "Tahoma">Copyright 2005 &copy; HACKPRO TM. All Rights Reserved.</FONT>';
  echo ' </DIV>';
  echo '</DIV>';
  echo '<DIV STYLE = "position:absolute; overflow:hidden; left:-3px; top:314px; width:180px; height:100px; z-index:2">';
  echo ' <IMG WIDTH = "180" HEIGHT = "100" BORDER = "0" SRC = "../images/phpLogo.gif">';
  echo '</DIV>';
  echo '<DIV STYLE = "position:absolute; overflow:hidden; left:9px; top:42px; width:190px; height:270px; z-index:1">';
  echo ' <DIV ALIGN = "justify">';
  echo '  <FONT STYLE = "font-size:9pt" COLOR = "#666699" FACE = "Tahoma">This fabulous class encrypts and decrypts any chain of characters,';
  echo '   it uses an encryption method without having an exact order neither a fixed size of chain.';
  echo '  </FONT>';
  echo ' </DIV>';
  echo ' <BR>';
  echo ' <DIV ALIGN = "justify">';
  echo '  <FONT STYLE = "font-size:9pt" COLOR = "#666699" FACE = "Tahoma">This class was developed originally by <B>Kelvin C. P&eacute;rez </B>';
  echo '   for the language VB and implemented in PHP by <B>Heriberto Mantilla Santamar&iacute;a</B>.<BR><BR>';
  echo '  </FONT>';
  echo ' </DIV>';
  echo ' <FONT STYLE = "font-size:9pt" COLOR = "#666699" FACE = "Tahoma"><B>Mails</B>';
  echo '  <BR><BR>kelvin_perez@msn.com<BR>heri_05-hms@mixmail.com';
  echo ' </FONT>';
  echo '</DIV>';
  echo '<IMG WIDTH = "584" HEIGHT = "378" STYLE = "position:absolute; left:195px; top:43px; z-index:0" BORDER = "0" SRC = "../images/rect1.gif">';
  echo '<DIV STYLE = "position:absolute; left:241px; top:5px; width:535px; height:37px; z-index:1">';
  echo ' <DIV ALIGN = "center">';
  echo '  <FONT STYLE = "font-size:24pt" COLOR = "#666699" FACE = "Tahoma"><B>Demo - Encryption Method</B></FONT>';
  echo ' </DIV>';
  echo '</DIV>';
  echo '<DIV STYLE = "POSITION:ABSOLUTE; HEIGHT:22; WIDTH:220px; LEFT:240px; TOP:90px; z-index:2">';
  echo '<TABLE FRAME = "BOX" NAME = "TABLAPPAL" BORDER = "1" BORDERCOLOR = "#899DB8" STYLE = "border-collapse: collapse;">';
  echo ' <TBODY>';
  echo '  <TR>';
  echo '  <TD CLASS = "TABLA" ALIGN = "CENTER" BACKGROUND = "..\images\bground.gif"<FONT STYLE = "font-size:8pt" COLOR = "#506EA6" FACE = "Verdana">&nbsp;<B>#</B></FONT></TD>';
  echo '  <TD CLASS = "TABLA" ALIGN = "CENTER" BACKGROUND = "..\images\bground.gif"><FONT STYLE = "font-size:8pt" COLOR = "#506EA6" FACE = "Verdana">&nbsp;<B>Result</B></FONT></TD>';
  echo '  <TD CLASS = "TABLA" ALIGN = "CENTER" BACKGROUND = "..\images\bground.gif"><FONT STYLE = "font-size:8pt" COLOR = "#506EA6" FACE = "Verdana">&nbsp;<B>Len</B></FONT></TD>';
  echo '  </TR>';
  if ($HTTP_POST_VARS["AllOK"] == "OK")
  {require_once("EnDecryptText.php");    // Abre la instancia EnDecryptText.php.
   $EnDecryptText = new EnDecryptText(); // Crea una nueva instancia de EnDecryptText.php.
   // Encripto 6 veces la misma palabra.
   for ($i = 1; $i <= 12; $i++)
   {echo '<TR>';
    $sTemp = $EnDecryptText->Encrypt_Text($HTTP_POST_VARS["Chain"]);
    echo '  <TD WIDTH = "10%" CLASS = "TABLA" ALIGN = "CENTER"><FONT STYLE = "font-size:8pt" COLOR = "#506EA6" FACE = "Verdana">&nbsp;' . $i . '</FONT></TD>';
    echo '  <TD WIDTH = "60%" CLASS = "TABLA" ALIGN = "LEFT"><FONT STYLE = "font-size:8pt" COLOR = "#506EA6" FACE = "Verdana">&nbsp;' . $sTemp . '</FONT></TD>';
    echo '  <TD WIDTH = "30%" CLASS = "TABLA" ALIGN = "CENTER"><FONT STYLE = "font-size:8pt" COLOR = "#506EA6" FACE = "Verdana">&nbsp;' . strlen($sTemp) . '</FONT></TD>';
    echo '</TR>';
	$rText = $EnDecryptText->Decrypt_Text($sTemp);
   }
  }
  echo ' </TBODY>';
  echo '</TABLE>';
  echo '</DIV>';
  echo '<DIV STYLE = "position:absolute; left:232px; top:64px; width:486px; height:18px; z-index:1">';
  echo ' <DIV>';
  echo '  <FONT STYLE = "font-size:10pt" COLOR="#666699" FACE = "Tahoma"><B>Encrypt Text: </B>' . $rText . '</FONT>';
  echo ' </DIV>';
  echo '</DIV>';?>
  <DIV STYLE = "POSITION:ABSOLUTE; HEIGHT:66; WIDTH:92px; LEFT:238px; TOP:310px; z-index:2">
   <A HREF = "..\Demo.html" CLASS = "TABLA"><FONT STYLE = "font-size:8pt" COLOR = "#506EA6" FACE = "Verdana">- BACK -</FONT></A>
  </DIV>
  <DIV STYLE = "position:absolute; overflow:hidden; left:478px; top:257px; width:300px; height:150px; z-index:1">
   <IMG WIDTH = "300" HEIGHT = "150" BORDER = "0" SRC = "../images/Logo.gif">
  </DIV>
 </BODY>
</HTML>