I'm too tired at this time to elaborate everything. I'm claiming that its innovative to have taken a key attribute to articulate characteristics of the modified key, used in the second cipher pass. I have been using it for the desireable ability to restrict output domain. Recent analysis with matrices, mathematically revealed the benefit of an added masking feature. So I added it in an efficient manner and introduced a fair number of possible solutions to the matrix problem./* =================================================================== +=== --JavaScript Source File -- NAME: CipherText_II.js (Patent-Pending) AUTHOR: Charles Prichard <greentv@paulbunyan.net> For testing purposes only!!! All other uses require writing!!! REVISION/DATE: 02-05-01 PURPOSE: Text encryption. NEW mask feature added to LEVEL_II cipher mode. NEW user-friendly alphabetic key option not fully supported. ====================================================================== + */ var USERMODE; var MODE; var r_key; var att; var offset; var s_key; var xString; var xStr; var _mask = new Array(9,29,19,6,13,5,24,25,19,7,21,9,3,30,10,15,19,18, +22,19,8,18,30,0,11,2,27,27,15,27,0,15); function newkey(){ USERMODE = "NUMERIC"; s_key = Make_shiftedKey(); offset = Math.floor(att/32); } function Encode(xString,cipher_key){ xStr = cipher(xString,cipher_key); return xStr; } function Decode(xString,cipher_key){ offset = -offset; xStr = cipher(xString,cipher_key); return xStr; } function cipher(xString,cipher_key){ var xStr=""; var newkey; var keylen = cipher_key.length; var i = xString.length % keylen; for(var cntr=0; cntr <= xString.length-1; cntr++){ if ((xString.charCodeAt(cntr) != 0x0d) && (xString.charCodeAt(cn +tr) != 0x0a)){ if (USERMODE == "NUMERIC"){ newkey = cipher_key.charC +odeAt(i) - 0x1f;} else { if (USERMODE == "ALPHABETIC"){ newkey = cipher +_key.charCodeAt(i) - 0x3f;} } xStr += String.fromCharCode(((newkey) ^ (xString.charCode +At(cntr)-0x1f)+offset)+0x1f); } else if ((xString.charCodeAt(cntr) == 0x0d) || (xString.charCod +eAt(cntr) == 0x0a)){ xStr += xString.charAt(cntr); } i++; if (i == keylen){i = 0;} } return (xStr); } function setAttribute(){ att = 0x00; var keyval; for (var i=0; i <= r_key.length-1; i++){ keyval = r_key.charCodeAt(i) - 0x20; att = att ^ keyval; } return att; } function Make_reverseKey(){ var _keyArray = new Array(); for(var i=0; i < r_key.length; i++){ _keyArray[i] = r_key.charAt(i); } _keyArray.reverse(); return _keyArray.join(""); } function Make_shiftedKey(){ var shift = setAttribute(); s_key = Make_reverseKey(); if ((shift % 2) == 1){s_key = s_key.substring(1,s_key.length);} else {s_key = s_key.substring(0,s_key.length-1);} var element; for (var i=0; i <= (shift - 1) % s_key.length; i++){ element = s_key.substring(0,1); s_key = s_key.substring(1,s_key.length); if (USERMODE = "NUMERIC"){ s_key = s_key + String.fromCharCode(_mask[element.char +CodeAt(0) - 31] + 31); } else { if (USERMODE = "ALPHABETIC"){ s_key = s_key + String.fromCharCode(_mask[element.char +CodeAt(0) - 63] + 63);} } } return s_key; }
In reply to Re: Re (tilly) 1: CipherText
by Steeeeeve
in thread CipherText
by NodeReaper
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |