Yogaswara’s Life


PROGRAM ERROR
October 20, 2008, 3:50 am
Filed under: Tugas Kuliah, Tugas Security, Uncategorized

LIST PROGRAM ENCRIPTION ERROR

<HTML>

<HEAD>

<TITLE> Password Protection: ASCII Encryption</TITLE>

<SCRIPT LANGUAGE=”JavaScript”>

<!– Begin

function Encrypt(theText) {

output = new String;

Temp = new Array();

Temp2 = new Array();

TextSize = theText.length;

for (i = 0; i < TextSize; i++) {

rnd = Math.round(Math.random() * 122) + 68;

Temp[i] = theText.charCodeAt(i) + rnd;

Temp2[i] = rnd;

}

for (i = 0; i < TextSize; i++) {

output += String.fromCharCode(Temp[i], Temp2[i]);

}

return output;

}

function unEncrypt(theText) {

output = new String;

Temp = new Array();

Temp2 = new Array();

TextSize = theText.length;

for (i = 0; i < TextSize; i++) {

Sintaks error

Sintaks errorTemp[i] = theText.charCodeAt(i);

Temp2[i] = theText.charCodeAt(i + 1);

}

for (i = 0; i < TextSize; i = i+5) {

output += String.fromCharCode(Temp[i] – Temp2[i]);

}

return output;

}

// End –>

</script>

</HEAD>

<BODY BGCOLOR=#ffff00 vlink=#0000ff>

<BR>

<center>

<table width=600 cellpadding=0 cellspacing=10>

<tr>

<td width=468 align=center>

</td>

<td width=120 align=center>

</td>

</tr>

</table>

<BR>

<BR>

<basefont size=3>

<FONT SIZE=”+2″ FACE=”Helvetica,Arial”>

<font color=”blue” size=”14″><b>Password Protection </b></font></A>

<br>

<FONT COLOR=”red”><b>ASCII Encryption</b></font></font>

<BR>

<BR>

<table BORDER=0 WIDTH=486 CELLPADDING=3 CELLSPACING=0>

<tr><td><font FACE=”lucida san,arial,webdings” Font color=#2f22f1>

<br>

<br>

<!– Description –><!–content_start–>

Program ini adalah metode sederhana encripsi menggunakan nilai acak untuk tiap karakter, Dalam metode ini anda dapat mengenkripsi kata/kalimat, dan dalam waktu yang sama dapat melihat hasilnya kode encripsi akan berbeda

<hr>

<br>

<br>

</td></tr

</table>

<!– Demonstration –>

<center>

<form name=encform onsubmit=”return false;”>

<textarea name=box1 rows=5 cols=50>Silahkan masukan kata / kalimat</textarea>

<p>

<b>(Click”Encrypt” dan lihatlah karakter hasilnya!)</b>

<p>

<input type=button value=”Encrypt ” onClick=”this.form.box2.value=Encrypt(this.form.box1.value);”>

<p>

<textarea name=box2 rows=5 cols=50></textarea>

<p>

<b>(Setelah Click “Decrypt” maka akan terlihat kata/kalimat sesuai aslinya)</b>

<p>

<input type=button value=”Decrypt ” onClick=”this.form.box3.value=unEncrypt(this.form.box2.value);”>

<p>

<textarea name=box3 rows=5 cols=50></textarea>

</form>

</center>

<P>

<P>

</form>

</FONT>

</CENTER>

</center>

</body></html>

Advertisement

Leave a Comment so far
Leave a comment



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s



Follow

Get every new post delivered to your Inbox.