URL Encryption

[Total: 0    Average: 0/5]

This script will take a valid URL address and convert it into a non-user readble format that still works.

Head Code:

<SCRIPT LANGUAGE="JavaScript">
<!-- 

function encrypt(form) {
  // the following letters and numbers and other characters are going
  // to be encrypted.
  letters = "abcdefghijklmnopqrstuvwxyz/.1234567890~_:";
  
  encrypt = new Array(
  "%61","%62","c","%64","e","%66",
  "%67","%68","%69","%6a","%6b","%6c",
  "m","n","o","%70","%71","%72",
  "%73","t","%75","%76","w","%78",
  "%79","%7a","/","."
  ,"1","2","3","4","5","6","7","8",
  "9","0","~","_","!",":");
  
  form.output.value = "";
  var input = form.input.value;
  output = "";
  for(var count = 0; count < input.length; count++) {
    daChar = input.charAt(count);
    for (i = 0; i < letters.length; i++) {
      if (daChar == letters.charAt(i)) {
        output += encrypt[i];
        break;
      }
    }
  }
  form.output.value = output;
}
//  End -->
</script>

Body Code:

<form>
Enter into this box the URL that you want to encrypt:<BR>
<textarea name=input cols=50 rows=1 wrap=physical></textarea><BR>
This is where the encrypted URL will appear:
<input type=button value="Encrypt" onClick="javascript:encrypt(this.form)"><BR>
<textarea name=output cols=50 rows=1 wrap=physical></textarea>
</form>

Times Viewed: 3

Leave a Reply

Your email address will not be published. Required fields are marked *