js01学者网
第一个参数密码 第二个cookies 第三第四固定`function strEnc(E, u, a, d) {var g = E.length;
var h = "";
var B, v, s, F, f, l;
if (u != null && u != "") {
B = getKeyBytes(u);
F = B.length
}
if (a != null && a != "") {
v = getKeyBytes(a);
f = v.length
}
if (d != null && d != "") {
s = getKeyBytes(d);
l = s.length
}
if (g > 0) {
if (g < 4) {
var C = strToBt(E);
var e;
if (u != null && u != "" && a != null && a != "" && d != null && d != "") {
var A;
var q, p, o;
A = C;
for (q = 0; q < F; q++) {
A = enc(A, B)
}
for (p = 0; p < f; p++) {
A = enc(A, v)
}
for (o = 0; o < l; o++) {
A = enc(A, s)
}
e = A
} else {
if (u != null && u != "" && a != null && a != "") {
var A;
var q, p;
A = C;
for (q = 0; q < F; q++) {
A = enc(A, B)
}
for (p = 0; p < f; p++) {
A = enc(A, v)
}
e = A
} else {
if (u != null && u != "") {
var A;
var q = 0;
A = C;
for (q = 0; q < F; q++) {
A = enc(A, B)
}
e = A
}
}
}
h = bt64ToHex(e)
} else {
var t = parseInt(g / 4);
var r = g % 4;
var w = 0;
for (w = 0; w < t; w++) {
var c = E.substring(w * 4 + 0, w * 4 + 4);
var D = strToBt(c);
var e;
if (u != null && u != "" && a != null && a != "" && d != null && d != "") {
var A;
var q, p, o;
A = D;
for (q = 0; q < F; q++) {
A = enc(A, B)
}
for (p = 0; p < f; p++) {
A = enc(A, v)
}
for (o = 0; o < l; o++) {
A = enc(A, s)
}
e = A
} else {
if (u != null && u != "" && a != null && a != "") {
var A;
var q, p;
A = D;
for (q = 0; q < F; q++) {
A = enc(A, B)
}
for (p = 0; p < f; p++) {
A = enc(A, v)
}
e = A
} else {
if (u != null && u != "") {
var A;
var q;
A = D;
for (q = 0; q < F; q++) {
A = enc(A, B)
}
e = A
}
}
}
h += bt64ToHex(e)
}
if (r > 0) {
var b = E.substring(t * 4 + 0, g);
var D = strToBt(b);
var e;
if (u != null && u != "" && a != null && a != "" && d != null && d != "") {
var A;
var q, p, o;
A = D;
for (q = 0; q < F; q++) {
A = enc(A, B)
}
for (p = 0; p < f; p++) {
A = enc(A, v)
}
for (o = 0; o < l; o++) {
A = enc(A, s)
}
e = A
} else {
if (u != null && u != "" && a != null && a != "") {
var A;
var q, p;
A = D;
for (q = 0; q < F; q++) {
A = enc(A, B)
}
for (p = 0; p < f; p++) {
A = enc(A, v)
}
e = A
} else {
if (u != null && u != "") {
var A;
var q;
A = D;
for (q = 0; q < F; q++) {
A = enc(A, B)
}
e = A
}
}
}
h += bt64ToHex(e)
}
}
}
return h
}
function strDec(D, t, a, c) {
var e = D.length;
var f = "";
var B, v, q, E, d, h;
if (t != null && t != "") {
B = getKeyBytes(t);
E = B.length
}
if (a != null && a != "") {
v = getKeyBytes(a);
d = v.length
}
if (c != null && c != "") {
q = getKeyBytes(c);
h = q.length
}
var s = parseInt(e / 16);
var A = 0;
for (A = 0; A < s; A++) {
var b = D.substring(A * 16 + 0, A * 16 + 16);
var g = hexToBt64(b);
var C = new Array(64);
var u = 0;
for (u = 0; u < 64; u++) {
C = parseInt(g.substring(u, u + 1))
}
var r;
if (t != null && t != "" && a != null && a != "" && c != null && c != "") {
var w;
var p, o, l;
w = C;
for (p = h - 1; p >= 0; p--) {
w = dec(w, q)
}
for (o = d - 1; o >= 0; o--) {
w = dec(w, v)
}
for (l = E - 1; l >= 0; l--) {
w = dec(w, B)
}
r = w
} else {
if (t != null && t != "" && a != null && a != "") {
var w;
var p, o, l;
w = C;
for (p = d - 1; p >= 0; p--) {
w = dec(w, v)
}
for (o = E - 1; o >= 0; o--) {
w = dec(w, B)
}
r = w
} else {
if (t != null && t != "") {
var w;
var p, o, l;
w = C;
for (p = E - 1; p >= 0; p--) {
w = dec(w, B)
}
r = w
}
}
}
f += byteToString(r)
}
return f
}
function getKeyBytes(d) {
var a = new Array();
var c = d.length;
var e = parseInt(c / 4);
var f = c % 4;
var b = 0;
for (b = 0; b < e; b++) {
a = strToBt(d.substring(b * 4 + 0, b * 4 + 4))
}
if (f > 0) {
a = strToBt(d.substring(b * 4 + 0, c))
}
return a
}
function strToBt(l) {
var a = l.length;
var o = new Array(64);
if (a < 4) {
var g = 0
, f = 0
, c = 0
, b = 0;
for (g = 0; g < a; g++) {
var e = l.charCodeAt(g);
for (f = 0; f < 16; f++) {
var h = 1
, d = 0;
for (d = 15; d > f; d--) {
h *= 2
}
o = parseInt(e / h) % 2
}
}
for (c = a; c < 4; c++) {
var e = 0;
for (b = 0; b < 16; b++) {
var h = 1
, d = 0;
for (d = 15; d > b; d--) {
h *= 2
}
o = parseInt(e / h) % 2
}
}
} else {
for (g = 0; g < 4; g++) {
var e = l.charCodeAt(g);
for (f = 0; f < 16; f++) {
var h = 1;
for (d = 15; d > f; d--) {
h *= 2
}
o = parseInt(e / h) % 2
}
}
}
return o
}
function bt4ToHex(b) {
var a;
switch (b) {
case "0000":
a = "0";
break;
case "0001":
a = "1";
break;
case "0010":
a = "2";
break;
case "0011":
a = "3";
break;
case "0100":
a = "4";
break;
case "0101":
a = "5";
break;
case "0110":
a = "6";
break;
case "0111":
a = "7";
break;
case "1000":
a = "8";
break;
case "1001":
a = "9";
break;
case "1010":
a = "A";
break;
case "1011":
a = "B";
break;
case "1100":
a = "C";
break;
case "1101":
a = "D";
break;
case "1110":
a = "E";
break;
case "1111":
a = "F";
break
}
return a
}
function hexToBt4(a) {
var b;
switch (a) {
case "0":
b = "0000";
break;
case "1":
b = "0001";
break;
case "2":
b = "0010";
break;
case "3":
b = "0011";
break;
case "4":
b = "0100";
break;
case "5":
b = "0101";
break;
case "6":
b = "0110";
break;
case "7":
b = "0111";
break;
case "8":
b = "1000";
break;
case "9":
b = "1001";
break;
case "A":
b = "1010";
break;
case "B":
b = "1011";
break;
case "C":
b = "1100";
break;
case "D":
b = "1101";
break;
case "E":
b = "1110";
break;
case "F":
b = "1111";
break
}
return b
}
function byteToString(d) {
var c = "";
for (i = 0; i < 4; i++) {
var b = 0;
for (j = 0; j < 16; j++) {
var a = 1;
for (m = 15; m > j; m--) {
a *= 2
}
b += d * a
}
if (b != 0) {
c += String.fromCharCode(b)
}
}
return c
}
function bt64ToHex(c) {
var b = "";
for (i = 0; i < 16; i++) {
var a = "";
for (j = 0; j < 4; j++) {
a += c
}
b += bt4ToHex(a)
}
return b
}
function hexToBt64(a) {
var b = "";
for (i = 0; i < 16; i++) {
b += hexToBt4(a.substring(i, i + 1))
}
return b
}
function enc(b, q) {
var t = generateKeys(q);
var p = initPermute(b);
var c = new Array(32);
var s = new Array(32);
var g = new Array(32);
var o = 0
, l = 0
, h = 0
, f = 0
, e = 0;
for (h = 0; h < 32; h++) {
c = p;
s = p
}
for (o = 0; o < 16; o++) {
for (l = 0; l < 32; l++) {
g = c;
c = s
}
var r = new Array(48);
for (f = 0; f < 48; f++) {
r = t
}
var a = xor(pPermute(sBoxPermute(xor(expandPermute(s), r))), g);
for (e = 0; e < 32; e++) {
s = a
}
}
var d = new Array(64);
for (o = 0; o < 32; o++) {
d = s;
d = c
}
return finallyPermute(d)
}
function dec(b, q) {
var t = generateKeys(q);
var p = initPermute(b);
var c = new Array(32);
var s = new Array(32);
var g = new Array(32);
var o = 0
, l = 0
, h = 0
, f = 0
, e = 0;
for (h = 0; h < 32; h++) {
c = p;
s = p
}
for (o = 15; o >= 0; o--) {
for (l = 0; l < 32; l++) {
g = c;
c = s
}
var r = new Array(48);
for (f = 0; f < 48; f++) {
r = t
}
var a = xor(pPermute(sBoxPermute(xor(expandPermute(s), r))), g);
for (e = 0; e < 32; e++) {
s = a
}
}
var d = new Array(64);
for (o = 0; o < 32; o++) {
d = s;
d = c
}
return finallyPermute(d)
}
function initPermute(b) {
var a = new Array(64);
for (i = 0,
m = 1,
n = 0; i < 4; i++,
m += 2,
n += 2) {
for (j = 7,
k = 0; j >= 0; j--,
k++) {
a = b;
a = b
}
}
return a
}
function expandPermute(a) {
var b = new Array(48);
for (i = 0; i < 8; i++) {
if (i == 0) {
b = a
} else {
b = a
}
b = a;
b = a;
b = a;
b = a;
if (i == 7) {
b = a
} else {
b = a
}
}
return b
}
function xor(c, b) {
var a = new Array(c.length);
for (i = 0; i < c.length; i++) {
a = c ^ b
}
return a
}
function sBoxPermute(c) {
var a = new Array(32);
var e = "";
var r = [, , , ];
var q = [, , , ];
var p = [, , , ];
var o = [, , , ];
var l = [, , , ];
var h = [, , , ];
var g = [, , , ];
var f = [, , , ];
for (m = 0; m < 8; m++) {
var d = 0
, b = 0;
d = c * 2 + c;
b = c * 2 * 2 * 2 + c * 2 * 2 + c * 2 + c;
switch (m) {
case 0:
e = getBoxBinary(r);
break;
case 1:
e = getBoxBinary(q);
break;
case 2:
e = getBoxBinary(p);
break;
case 3:
e = getBoxBinary(o);
break;
case 4:
e = getBoxBinary(l);
break;
case 5:
e = getBoxBinary(h);
break;
case 6:
e = getBoxBinary(g);
break;
case 7:
e = getBoxBinary(f);
break
}
a = parseInt(e.substring(0, 1));
a = parseInt(e.substring(1, 2));
a = parseInt(e.substring(2, 3));
a = parseInt(e.substring(3, 4))
}
return a
}
function pPermute(b) {
var a = new Array(32);
a = b;
a = b;
a = b;
a = b;
a = b;
a = b;
a = b;
a = b;
a = b;
a = b;
a = b;
a = b;
a = b;
a = b;
a = b;
a = b;
a = b;
a = b;
a = b;
a = b;
a = b;
a = b;
a = b;
a = b;
a = b;
a = b;
a = b;
a = b;
a = b;
a = b;
a = b;
a = b;
return a
}
function finallyPermute(a) {
var b = new Array(64);
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
b = a;
return b
}
function getBoxBinary(a) {
var b = "";
switch (a) {
case 0:
b = "0000";
break;
case 1:
b = "0001";
break;
case 2:
b = "0010";
break;
case 3:
b = "0011";
break;
case 4:
b = "0100";
break;
case 5:
b = "0101";
break;
case 6:
b = "0110";
break;
case 7:
b = "0111";
break;
case 8:
b = "1000";
break;
case 9:
b = "1001";
break;
case 10:
b = "1010";
break;
case 11:
b = "1011";
break;
case 12:
b = "1100";
break;
case 13:
b = "1101";
break;
case 14:
b = "1110";
break;
case 15:
b = "1111";
break
}
return b
}
function generateKeys(c) {
var e = new Array(56);
var f = new Array();
f = new Array();
f = new Array();
f = new Array();
f = new Array();
f = new Array();
f = new Array();
f = new Array();
f = new Array();
f = new Array();
f = new Array();
f = new Array();
f = new Array();
f = new Array();
f = new Array();
f = new Array();
f = new Array();
var a = ;
for (d = 0; d < 7; d++) {
for (j = 0,
k = 7; j < 8; j++,
k--) {
e = c
}
}
var d = 0;
for (d = 0; d < 16; d++) {
var h = 0;
var b = 0;
for (j = 0; j < a; j++) {
h = e;
b = e;
for (k = 0; k < 27; k++) {
e = e;
e = e
}
e = h;
e = b
}
var g = new Array(48);
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
g = e;
switch (d) {
case 0:
for (m = 0; m < 48; m++) {
f = g
}
break;
case 1:
for (m = 0; m < 48; m++) {
f = g
}
break;
case 2:
for (m = 0; m < 48; m++) {
f = g
}
break;
case 3:
for (m = 0; m < 48; m++) {
f = g
}
break;
case 4:
for (m = 0; m < 48; m++) {
f = g
}
break;
case 5:
for (m = 0; m < 48; m++) {
f = g
}
break;
case 6:
for (m = 0; m < 48; m++) {
f = g
}
break;
case 7:
for (m = 0; m < 48; m++) {
f = g
}
break;
case 8:
for (m = 0; m < 48; m++) {
f = g
}
break;
case 9:
for (m = 0; m < 48; m++) {
f = g
}
break;
case 10:
for (m = 0; m < 48; m++) {
f = g
}
break;
case 11:
for (m = 0; m < 48; m++) {
f = g
}
break;
case 12:
for (m = 0; m < 48; m++) {
f = g
}
break;
case 13:
for (m = 0; m < 48; m++) {
f = g
}
break;
case 14:
for (m = 0; m < 48; m++) {
f = g
}
break;
case 15:
for (m = 0; m < 48; m++) {
f = g
}
break
}
}
return f
}
;`
页:
[1]