...

View Full Version : Encryptor



mex
07-04-2004, 07:17 AM
The below is a simple script to encrypt!!! Can anyone help me out so that it can decrypt the stuff again back to its original code.... :confused:

<html><script language="JavaScript"><!--

i=0;
s=0;
num=0;
seq1="",seq2="";

ie = document.all?1:0;
ns = document.layers?1:0;
ns6 = document.getElementById?1:0;
svet = "";

function generate(what)
{
code = document.pad.text;
if (code.value.length>0) code.value = "<script language=JavaScript>m='"+escape(code.value)+"';d=unescape(m);document.write(d);<\/script>";
else if (code.value.length == "")
{
alert('Hey PASTE the html before clicking that stuff');
document.pad.text.focus();
}
}

function selectCode()
{
padText=document.pad.text;
if(padText.value.length>0)
{
if (ie)
{
therange=padText.createTextRange();
therange.execCommand("Copy");
window.status="Encrypted HTML copied to Clipboard!";
setTimeout("window.status=''",1800);
}
padText.focus();
padText.select();
}
else alert('Please paste your HTML code into the box first...')
}

function dothisfirst(what, message)
{
if (ie||ns6)
{
window.status=message;
what.style.backgroundColor='#EAEAEA';
what.style.cursor='hand';
}
else window.status=message;
}
function thendothis(what)
{
if (ie||ns6)
{
what.style.backgroundColor='white';
window.status='';
}
else window.status='';
}
// --></script>
</p><center>
<table border="0" width="100%" cellspacing="0" cellpadding="5" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<td valign="top" align="left">
<center><font size="2" color="#008000" face="Arial"><i>
<b>Paste original HTML in the box:</b></i></font></center>
<form method="post" name="pad" align="center">
<table border="0" cellspacing="0" cellpadding="0" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<td width="425">
<textarea nowrap class="box" rows="15" name="text" cols="77" wrap></textarea></td>
</tr>
<tr>
<td width="425">
<br>
<div align="center">
<center>
<table border="0" width="100%" cellspacing="6" cellpadding="0">
<tr>
<td width="100%" align="center"><input class="but" type="button" value="Encrypt HTML" name="compileIt" onClick="generate()" onMouseOver="dothisfirst(this, 'Encrypt The HTML Code...')" onMouseOut="thendothis(this)"></td>
</tr>
<tr>
<td width="100%" align="center"><input class="but" type="button" value="Place Encrypted HTML Code Onto The Clipboard" name="select" onClick="selectCode()" onMouseOver="dothisfirst(this, 'Select the encrypted code and copy it to the clipboard...')" onMouseOut="thendothis(this)"></td>
</tr>
<tr>
<td width="100%" align="center"><input class="but" type="reset" value="Clear Box (Start Over)" name="clear" onMouseOver="dothisfirst(this, 'Clear the code from the box above!')" onMouseOut="thendothis(this)"></td>
</tr>
</table>
</center>
</div>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</center>
</html>

JohnKrutsch
07-04-2004, 08:05 AM
If you just wanted this utlity to be able to decrypt the stuff that it encrypted then you could just modify the encrypt function:



function degenerate(what){
code = document.pad.text;
if (code.value.length>0){
code.value=unescape(code.value.substring(code.value.indexOf("'")+1,code.value.lastIndexOf("'")));
}else if (code.value.length == ""){
alert('Hey PASTE the encrypted html before clicking that stuff');
document.pad.text.focus();
}
}

mex
07-04-2004, 08:47 AM
I replace your script with mine and IT DIDN'T WORK ANYMORE.... can u be please more specific with the script... thanx

JohnKrutsch
07-04-2004, 08:02 PM
The function I posted is not a replacement for any of the functions you had, it is an additional function based on the generate function. Put the function I wrote up into your script with all of the other functions. Then of course you will have to add a button to the the page which will call the degenerate function.

mex
07-06-2004, 02:01 PM
welll... thanx but can u let me know the Decrypt code button as the ones i tried are not working... I dont know why!!!!!

Thanx anyway

Serex
07-06-2004, 02:31 PM
ok. remind you that he is mod so try be a lil more courteous next time. he has done you a favour and the code worked fine besides the forgotten {

all you needed to do yourself was create your own button set the onclick to the function and its done.

i done a quick job here. can easily be done better.



<html><script language="JavaScript"><!--

i=0;
s=0;
num=0;
seq1="",seq2="";

ie = document.all?1:0;
ns = document.layers?1:0;
ns6 = document.getElementById?1:0;
svet = "";

function generate(what)
{
code = document.pad.text;
if (code.value.length>0) code.value = "<script language=JavaScript>m='"+escape(code.value)+"';d=unescape(m);document.write(d);<\/script>";
else if (code.value.length == "")
{
alert('Hey PASTE the html before clicking that stuff');
document.pad.text.focus();
}
}

function selectCode()
{
padText=document.pad.text;
if(padText.value.length>0)
{
if (ie)
{
therange=padText.createTextRange();
therange.execCommand("Copy");
window.status="Encrypted HTML copied to Clipboard!";
setTimeout("window.status=''",1800);
}
padText.focus();
padText.select();
}
else alert('Please paste your HTML code into the box first...')
}

function degenerate(what)
{
code = document.pad.text;
if (code.value.length>0)
{
code.value=unescape(code.value.substring(code.value.indexOf("'")+1,code.value.lastIndexOf("'")));
}
else if (code.value.length == "")
{
alert('Hey PASTE the encrypted html before clicking that stuff');
document.pad.text.focus();
}
}

function dothisfirst(what, message)
{
if (ie||ns6)
{
window.status=message;
what.style.backgroundColor='#EAEAEA';
what.style.cursor='hand';
}
else window.status=message;
}
function thendothis(what)
{
if (ie||ns6)
{
what.style.backgroundColor='white';
window.status='';
}
else window.status='';
}
// --></script>
</p><center>
<table border="0" width="100%" cellspacing="0" cellpadding="5" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<td valign="top" align="left">
<center><font size="2" color="#008000" face="Arial"><i>
<b>Paste original HTML in the box:</b></i></font></center>
<form method="post" name="pad" align="center">
<table border="0" cellspacing="0" cellpadding="0" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<td width="425">
<textarea nowrap class="box" rows="15" name="text" cols="77" wrap></textarea></td>
</tr>
<tr>
<td width="425">
<br>
<div align="center">
<center>
<table border="0" width="100%" cellspacing="6" cellpadding="0">
<tr>
<td width="100%" align="center"><input class="but" type="button" value="Encrypt HTML" name="compileIt" onClick="generate()" onMouseOver="dothisfirst(this, 'Encrypt The HTML Code...')" onMouseOut="thendothis(this)"></td>
</tr>
<tr>
<td width="100%" align="center"><input class="but" type="button" value="DeEncrypt HTML" name="DecompileIt" onClick="degenerate()" onMouseOver="dothisfirst(this, 'Encrypt The HTML Code...')" onMouseOut="thendothis(this)"></td>
</tr>
<tr>
<td width="100%" align="center"><input class="but" type="button" value="Place Encrypted HTML Code Onto The Clipboard" name="select" onClick="selectCode()" onMouseOver="dothisfirst(this, 'Select the encrypted code and copy it to the clipboard...')" onMouseOut="thendothis(this)"></td>
</tr>
<tr>
<td width="100%" align="center"><input class="but" type="reset" value="Clear Box (Start Over)" name="clear" onMouseOver="dothisfirst(this, 'Clear the code from the box above!')" onMouseOut="thendothis(this)"></td>
</tr>
</table>
</center>
</div>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</center>
</html>




you could also indent some of the code to make it cleaner and easier to read

mex
07-07-2004, 02:11 PM
Well I'm sorry if i have hurt anyone around here. anyway thanx so much for the help... though there's some error & not working in the script, I'll try to figure it out...

thanx again



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum