关于爬虫技术,登陆时对加密的js算法破解。在线等

enaking 2021-02-26 11:21:53
首先我看到登陆按钮的onclick中的函数,找到函数代码,如下

if (oldpwd != "") {
userPwd = encrypt.encrypt(oldpwd);
}
else {
userPwd = encrypt.encrypt($("#loginpwd").val());
}
if (userPwd != $("#loginpwd").val()) {
userPwd = encrypt.encrypt($("#loginpwd").val());
oldpwd = $("#loginpwd").val();
$("#loginpwd").val(userPwd);
}

由于我常年做winfrom代码,对js读码一半靠蒙,认为重点是encrypt.encrypt的函数中。
然后再靠蒙追到了/script/jsencrypt.min.js中的代码。看了里面代码我就没法蒙了。

有两问题,1、我找不到和encrypt.encrypt对应的函数,2、这段代码如何用c#摸拟写一遍

由于/script/jsencrypt.min.js代码量很长,我在本楼发代码,如果发不完,接着楼下发,谢谢各位高手

var JSEncryptExports = {}; (function(exports) {
function BigInteger(a, b, c) {
null != a && ("number" == typeof a ? this.fromNumber(a, b, c) : null == b && "string" != typeof a ? this.fromString(a, 256) : this.fromString(a, b))
}
function nbi() {
return new BigInteger(null)
}
function am1(a, b, c, d, e, f) {
for (; --f >= 0;) {
var g = b * this[a++] + c[d] + e;
e = Math.floor(g / 67108864),
c[d++] = 67108863 & g
}
return e
}
function am2(a, b, c, d, e, f) {
for (var g = 32767 & b,
h = b >> 15; --f >= 0;) {
var i = 32767 & this[a],
j = this[a++] >> 15,
k = h * i + j * g;
i = g * i + ((32767 & k) << 15) + c[d] + (1073741823 & e),
e = (i >>> 30) + (k >>> 15) + h * j + (e >>> 30),
c[d++] = 1073741823 & i
}
return e
}
function am3(a, b, c, d, e, f) {
for (var g = 16383 & b,
h = b >> 14; --f >= 0;) {
var i = 16383 & this[a],
j = this[a++] >> 14,
k = h * i + j * g;
i = g * i + ((16383 & k) << 14) + c[d] + e,
e = (i >> 28) + (k >> 14) + h * j,
c[d++] = 268435455 & i
}
return e
}
function int2char(a) {
return BI_RM.charAt(a)
}
function intAt(a, b) {
var c = BI_RC[a.charCodeAt(b)];
return null == c ? -1 : c
}
function bnpCopyTo(a) {
for (var b = this.t - 1; b >= 0; --b) a[b] = this[b];
a.t = this.t,
a.s = this.s
}
function bnpFromInt(a) {
this.t = 1,
this.s = 0 > a ? -1 : 0,
a > 0 ? this[0] = a: -1 > a ? this[0] = a + DV: this.t = 0
}
function nbv(a) {
var b = nbi();
return b.fromInt(a),
b
}
function bnpFromString(a, b) {
var c;
if (16 == b) c = 4;
else if (8 == b) c = 3;
else if (256 == b) c = 8;
else if (2 == b) c = 1;
else if (32 == b) c = 5;
else {
if (4 != b) return void this.fromRadix(a, b);
c = 2
}
this.t = 0,
this.s = 0;
for (var d = a.length,
e = !1,
f = 0; --d >= 0;) {
var g = 8 == c ? 255 & a[d] : intAt(a, d);
0 > g ? "-" == a.charAt(d) && (e = !0) : (e = !1, 0 == f ? this[this.t++] = g: f + c > this.DB ? (this[this.t - 1] |= (g & (1 << this.DB - f) - 1) << f, this[this.t++] = g >> this.DB - f) : this[this.t - 1] |= g << f, f += c, f >= this.DB && (f -= this.DB))
}
8 == c && 0 != (128 & a[0]) && (this.s = -1, f > 0 && (this[this.t - 1] |= (1 << this.DB - f) - 1 << f)),
this.clamp(),
e && BigInteger.ZERO.subTo(this, this)
}
function bnpClamp() {
for (var a = this.s & this.DM; this.t > 0 && this[this.t - 1] == a;)--this.t
}
function bnToString(a) {
if (this.s < 0) return "-" + this.negate().toString(a);
var b;
if (16 == a) b = 4;
else if (8 == a) b = 3;
else if (2 == a) b = 1;
else if (32 == a) b = 5;
else {
if (4 != a) return this.toRadix(a);
b = 2
}
var c, d = (1 << b) - 1,
e = !1,
f = "",
g = this.t,
h = this.DB - g * this.DB % b;
if (g-->0) for (h < this.DB && (c = this[g] >> h) > 0 && (e = !0, f = int2char(c)); g >= 0;) b > h ? (c = (this[g] & (1 << h) - 1) << b - h, c |= this[--g] >> (h += this.DB - b)) : (c = this[g] >> (h -= b) & d, 0 >= h && (h += this.DB, --g)),
c > 0 && (e = !0),
e && (f += int2char(c));
return e ? f: "0"
}
function bnNegate() {
var a = nbi();
return BigInteger.ZERO.subTo(this, a),
a
}
function bnAbs() {
return this.s < 0 ? this.negate() : this
}
function bnCompareTo(a) {
var b = this.s - a.s;
if (0 != b) return b;
var c = this.t;
if (b = c - a.t, 0 != b) return this.s < 0 ? -b: b;
for (; --c >= 0;) if (0 != (b = this[c] - a[c])) return b;
return 0
}
function nbits(a) {
var b, c = 1;
return 0 != (b = a >>> 16) && (a = b, c += 16),
0 != (b = a >> 8) && (a = b, c += 8),
0 != (b = a >> 4) && (a = b, c += 4),
0 != (b = a >> 2) && (a = b, c += 2),
0 != (b = a >> 1) && (a = b, c += 1),
c
}
function bnBitLength() {
return this.t <= 0 ? 0 : this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM)
}
function bnpDLShiftTo(a, b) {
var c;
for (c = this.t - 1; c >= 0; --c) b[c + a] = this[c];
for (c = a - 1; c >= 0; --c) b[c] = 0;
b.t = this.t + a,
b.s = this.s
}
function bnpDRShiftTo(a, b) {
for (var c = a; c < this.t; ++c) b[c - a] = this[c];
b.t = Math.max(this.t - a, 0),
b.s = this.s
}
function bnpLShiftTo(a, b) {
var c, d = a % this.DB,
e = this.DB - d,
f = (1 << e) - 1,
g = Math.floor(a / this.DB),
h = this.s << d & this.DM;
for (c = this.t - 1; c >= 0; --c) b[c + g + 1] = this[c] >> e | h,
h = (this[c] & f) << d;
for (c = g - 1; c >= 0; --c) b[c] = 0;
b[g] = h,
b.t = this.t + g + 1,
b.s = this.s,
b.clamp()
}
function bnpRShiftTo(a, b) {
b.s = this.s;
var c = Math.floor(a / this.DB);
if (c >= this.t) return void(b.t = 0);
var d = a % this.DB,
e = this.DB - d,
f = (1 << d) - 1;
b[0] = this[c] >> d;
for (var g = c + 1; g < this.t; ++g) b[g - c - 1] |= (this[g] & f) << e,
b[g - c] = this[g] >> d;
d > 0 && (b[this.t - c - 1] |= (this.s & f) << e),
b.t = this.t - c,
b.clamp()
}
function bnpSubTo(a, b) {
for (var c = 0,
d = 0,
e = Math.min(a.t, this.t); e > c;) d += this[c] - a[c],
b[c++] = d & this.DM,
d >>= this.DB;
if (a.t < this.t) {
for (d -= a.s; c < this.t;) d += this[c],
b[c++] = d & this.DM,
d >>= this.DB;
d += this.s
} else {
for (d += this.s; c < a.t;) d -= a[c],
b[c++] = d & this.DM,
d >>= this.DB;
d -= a.s
}
b.s = 0 > d ? -1 : 0,
-1 > d ? b[c++] = this.DV + d: d > 0 && (b[c++] = d),
b.t = c,
b.clamp()
}
function bnpMultiplyTo(a, b) {
var c = this.abs(),
d = a.abs(),
e = c.t;
for (b.t = e + d.t; --e >= 0;) b[e] = 0;
for (e = 0; e < d.t; ++e) b[e + c.t] = c.am(0, d[e], b, e, 0, c.t);
b.s = 0,
b.clamp(),
this.s != a.s && BigInteger.ZERO.subTo(b, b)
}
function bnpSquareTo(a) {
for (var b = this.abs(), c = a.t = 2 * b.t; --c >= 0;) a[c] = 0;
for (c = 0; c < b.t - 1; ++c) {
var d = b.am(c, b[c], a, 2 * c, 0, 1); (a[c + b.t] += b.am(c + 1, 2 * b[c], a, 2 * c + 1, d, b.t - c - 1)) >= b.DV && (a[c + b.t] -= b.DV, a[c + b.t + 1] = 1)
}
a.t > 0 && (a[a.t - 1] += b.am(c, b[c], a, 2 * c, 0, 1)),
a.s = 0,
a.clamp()
}
function bnpDivRemTo(a, b, c) {
var d = a.abs();
if (! (d.t <= 0)) {
var e = this.abs();
if (e.t < d.t) return null != b && b.fromInt(0),
void(null != c && this.copyTo(c));
null == c && (c = nbi());
var f = nbi(),
g = this.s,
h = a.s,
i = this.DB - nbits(d[d.t - 1]);
i > 0 ? (d.lShiftTo(i, f), e.lShiftTo(i, c)) : (d.copyTo(f), e.copyTo(c));
var j = f.t,
k = f[j - 1];
if (0 != k) {
var l = k * (1 << this.F1) + (j > 1 ? f[j - 2] >> this.F2: 0),
m = this.FV / l,
n = (1 << this.F1) / l,
o = 1 << this.F2,
p = c.t,
q = p - j,
r = null == b ? nbi() : b;
for (f.dlShiftTo(q, r), c.compareTo(r) >= 0 && (c[c.t++] = 1, c.subTo(r, c)), BigInteger.ONE.dlShiftTo(j, r), r.subTo(f, f); f.t < j;) f[f.t++] = 0;
for (; --q >= 0;) {
var s = c[--p] == k ? this.DM: Math.floor(c[p] * m + (c[p - 1] + o) * n);
if ((c[p] += f.am(0, s, c, q, 0, j)) < s) for (f.dlShiftTo(q, r), c.subTo(r, c); c[p] < --s;) c.subTo(r, c)
}
null != b && (c.drShiftTo(j, b), g != h && BigInteger.ZERO.subTo(b, b)),
c.t = j,
c.clamp(),
i > 0 && c.rShiftTo(i, c),
0 > g && BigInteger.ZERO.subTo(c, c)
}
}
}
function bnMod(a) {
var b = nbi();
return this.abs().divRemTo(a, null, b),
this.s < 0 && b.compareTo(BigInteger.ZERO) > 0 && a.subTo(b, b),
b
}
function Classic(a) {
this.m = a
}
function cConvert(a) {
return a.s < 0 || a.compareTo(this.m) >= 0 ? a.mod(this.m) : a
}
function cRevert(a) {
return a
}
function cReduce(a) {
a.divRemTo(this.m, null, a)
}
function cMulTo(a, b, c) {
a.multiplyTo(b, c),
this.reduce(c)
}
function cSqrTo(a, b) {
a.squareTo(b),
this.reduce(b)
}
function bnpInvDigit() {
if (this.t < 1) return 0;
var a = this[0];
if (0 == (1 & a)) return 0;
var b = 3 & a;
return b = b * (2 - (15 & a) * b) & 15,
b = b * (2 - (255 & a) * b) & 255,
b = b * (2 - ((65535 & a) * b & 65535)) & 65535,
b = b * (2 - a * b % this.DV) % this.DV,
b > 0 ? this.DV - b: -b
}
function Montgomery(a) {
this.m = a,
this.mp = a.invDigit(),
this.mpl = 32767 & this.mp,
this.mph = this.mp >> 15,
this.um = (1 << a.DB - 15) - 1,
this.mt2 = 2 * a.t
}
function montConvert(a) {
var b = nbi();
return a.abs().dlShiftTo(this.m.t, b),
b.divRemTo(this.m, null, b),
a.s < 0 && b.compareTo(BigInteger.ZERO) > 0 && this.m.subTo(b, b),
b
}
function montRevert(a) {
var b = nbi();
return a.copyTo(b),
this.reduce(b),
b
}
function montReduce(a) {
for (; a.t <= this.mt2;) a[a.t++] = 0;
for (var b = 0; b < this.m.t; ++b) {
var c = 32767 & a[b],
d = c * this.mpl + ((c * this.mph + (a[b] >> 15) * this.mpl & this.um) << 15) & a.DM;
for (c = b + this.m.t, a[c] += this.m.am(0, d, a, b, 0, this.m.t); a[c] >= a.DV;) a[c] -= a.DV,
a[++c]++
}
a.clamp(),
a.drShiftTo(this.m.t, a),
a.compareTo(this.m) >= 0 && a.subTo(this.m, a)
}
function montSqrTo(a, b) {
a.squareTo(b),
this.reduce(b)
}



...全文
1495 14 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
stherix 2021-03-03
  • 打赏
  • 举报
回复
最简单的就是用js自己破解 前端的东西没有加密可言的 顶多是c#里弄个V8引擎执行下他的js加密解密代码而已 如果想要用c#重写 找不到encrypt.encrypt? 在登录页面, chrome打开控制台, 输入encrypt.encrypt回车, chrome就把函数体给你打出来了
qq_41442872 2021-03-03
  • 打赏
  • 举报
回复
虽然不太懂,还是好厉害的样子
luj_1768 2021-03-02
  • 打赏
  • 举报
回复
先看看rsa算法简介(属于专业书籍,一般在数学或者邮电分目中),虽然各有不同、大思路都差不多。
sprc_lcl 2021-03-01
  • 打赏
  • 举报
回复
百度搜索“C# 执行js函数”
hztltgg 2021-03-01
  • 打赏
  • 举报
回复
引用 6 楼 enaking 的回复:
[quote=引用 3 楼 hztltgg 的回复:]一般是c#里直接执行这个js文件。 要找的话,就是在js里找一串私钥字符串,加密方式一般是rsa算法。
我在网上看到了相同的加密代码,后面还有后台代码 https://www.cnblogs.com/CallmeYhz/p/8522679.html 但我调用JsEncryptHelper js = new ImportHelper.JsEncryptHelper(); string strTmp = js.Encrypt(PWD.Text.Trim()); 所得strTmp和抓取的提交的密码并不相同。[/quote] RSA加密算法,有填充模式的区别,每次执行得到的就是不同的。
橘子皮... 2021-02-27
  • 打赏
  • 举报
回复
引用 8 楼 极客诗人 的回复:
手动登录后 或者通过selenium控制获取cookie 再做操作 多简单。
简单? 如果我需要同时间处理100个线程你给我试试看? 不懂别说简单
八爻老骥 2021-02-27
  • 打赏
  • 举报
回复
可以试试用nuget安装一个脚本引擎包去执行脚本。

比如:

NuGet Gallery | MsieJavaScriptEngine 3.0.7
https://www.nuget.org/packages/MsieJavaScriptEngine/3.0.7?_src=template

或者

NuGet Gallery | JavaScriptEngineSwitcher.Core 3.3.0
https://www.nuget.org/packages/JavaScriptEngineSwitcher.Core/3.3.0?_src=template
极客诗人 2021-02-27
  • 打赏
  • 举报
回复
手动登录后 或者通过selenium控制获取cookie 再做操作 多简单。
hztltgg 2021-02-26
  • 打赏
  • 举报
回复
一般是c#里直接执行这个js文件。 要找的话,就是在js里找一串私钥字符串,加密方式一般是rsa算法。
X-i-n 2021-02-26
  • 打赏
  • 举报
回复
如果js过于复杂,我会考虑用selenium,控制网页直接登录,然后取登录后的cookie。
enaking 2021-02-26
  • 打赏
  • 举报
回复

function montMulTo(a, b, c) {
		a.multiplyTo(b, c),
		this.reduce(c)
	}
	function bnpIsEven() {
		return 0 == (this.t > 0 ? 1 & this[0] : this.s)
	}
	function bnpExp(a, b) {
		if (a > 4294967295 || 1 > a) return BigInteger.ONE;
		var c = nbi(),
		d = nbi(),
		e = b.convert(this),
		f = nbits(a) - 1;
		for (e.copyTo(c); --f >= 0;) if (b.sqrTo(c, d), (a & 1 << f) > 0) b.mulTo(d, e, c);
		else {
			var g = c;
			c = d,
			d = g
		}
		return b.revert(c)
	}
	function bnModPowInt(a, b) {
		var c;
		return c = 256 > a || b.isEven() ? new Classic(b) : new Montgomery(b),
		this.exp(a, c)
	}
	function bnClone() {
		var a = nbi();
		return this.copyTo(a),
		a
	}
	function bnIntValue() {
		if (this.s < 0) {
			if (1 == this.t) return this[0] - this.DV;
			if (0 == this.t) return - 1
		} else {
			if (1 == this.t) return this[0];
			if (0 == this.t) return 0
		}
		return (this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0]
	}
	function bnByteValue() {
		return 0 == this.t ? this.s: this[0] << 24 >> 24
	}
	function bnShortValue() {
		return 0 == this.t ? this.s: this[0] << 16 >> 16
	}
	function bnpChunkSize(a) {
		return Math.floor(Math.LN2 * this.DB / Math.log(a))
	}
	function bnSigNum() {
		return this.s < 0 ? -1 : this.t <= 0 || 1 == this.t && this[0] <= 0 ? 0 : 1
	}
	function bnpToRadix(a) {
		if (null == a && (a = 10), 0 == this.signum() || 2 > a || a > 36) return "0";
		var b = this.chunkSize(a),
		c = Math.pow(a, b),
		d = nbv(c),
		e = nbi(),
		f = nbi(),
		g = "";
		for (this.divRemTo(d, e, f); e.signum() > 0;) g = (c + f.intValue()).toString(a).substr(1) + g,
		e.divRemTo(d, e, f);
		return f.intValue().toString(a) + g
	}
	function bnpFromRadix(a, b) {
		this.fromInt(0),
		null == b && (b = 10);
		for (var c = this.chunkSize(b), d = Math.pow(b, c), e = !1, f = 0, g = 0, h = 0; h < a.length; ++h) {
			var i = intAt(a, h);
			0 > i ? "-" == a.charAt(h) && 0 == this.signum() && (e = !0) : (g = b * g + i, ++f >= c && (this.dMultiply(d), this.dAddOffset(g, 0), f = 0, g = 0))
		}
		f > 0 && (this.dMultiply(Math.pow(b, f)), this.dAddOffset(g, 0)),
		e && BigInteger.ZERO.subTo(this, this)
	}
	function bnpFromNumber(a, b, c) {
		if ("number" == typeof b) if (2 > a) this.fromInt(1);
		else for (this.fromNumber(a, c), this.testBit(a - 1) || this.bitwiseTo(BigInteger.ONE.shiftLeft(a - 1), op_or, this), this.isEven() && this.dAddOffset(1, 0); ! this.isProbablePrime(b);) this.dAddOffset(2, 0),
		this.bitLength() > a && this.subTo(BigInteger.ONE.shiftLeft(a - 1), this);
		else {
			var d = new Array,
			e = 7 & a;
			d.length = (a >> 3) + 1,
			b.nextBytes(d),
			e > 0 ? d[0] &= (1 << e) - 1 : d[0] = 0,
			this.fromString(d, 256)
		}
	}
	function bnToByteArray() {
		var a = this.t,
		b = new Array;
		b[0] = this.s;
		var c, d = this.DB - a * this.DB % 8,
		e = 0;
		if (a-->0) for (d < this.DB && (c = this[a] >> d) != (this.s & this.DM) >> d && (b[e++] = c | this.s << this.DB - d); a >= 0;) 8 > d ? (c = (this[a] & (1 << d) - 1) << 8 - d, c |= this[--a] >> (d += this.DB - 8)) : (c = this[a] >> (d -= 8) & 255, 0 >= d && (d += this.DB, --a)),
		0 != (128 & c) && (c |= -256),
		0 == e && (128 & this.s) != (128 & c) && ++e,
		(e > 0 || c != this.s) && (b[e++] = c);
		return b
	}
	function bnEquals(a) {
		return 0 == this.compareTo(a)
	}
	function bnMin(a) {
		return this.compareTo(a) < 0 ? this: a
	}
	function bnMax(a) {
		return this.compareTo(a) > 0 ? this: a
	}
	function bnpBitwiseTo(a, b, c) {
		var d, e, f = Math.min(a.t, this.t);
		for (d = 0; f > d; ++d) c[d] = b(this[d], a[d]);
		if (a.t < this.t) {
			for (e = a.s & this.DM, d = f; d < this.t; ++d) c[d] = b(this[d], e);
			c.t = this.t
		} else {
			for (e = this.s & this.DM, d = f; d < a.t; ++d) c[d] = b(e, a[d]);
			c.t = a.t
		}
		c.s = b(this.s, a.s),
		c.clamp()
	}
	function op_and(a, b) {
		return a & b
	}
	function bnAnd(a) {
		var b = nbi();
		return this.bitwiseTo(a, op_and, b),
		b
	}
	function op_or(a, b) {
		return a | b
	}
	function bnOr(a) {
		var b = nbi();
		return this.bitwiseTo(a, op_or, b),
		b
	}
	function op_xor(a, b) {
		return a ^ b
	}
	function bnXor(a) {
		var b = nbi();
		return this.bitwiseTo(a, op_xor, b),
		b
	}
	function op_andnot(a, b) {
		return a & ~b
	}
	function bnAndNot(a) {
		var b = nbi();
		return this.bitwiseTo(a, op_andnot, b),
		b
	}
	function bnNot() {
		for (var a = nbi(), b = 0; b < this.t; ++b) a[b] = this.DM & ~this[b];
		return a.t = this.t,
		a.s = ~this.s,
		a
	}
	function bnShiftLeft(a) {
		var b = nbi();
		return 0 > a ? this.rShiftTo( - a, b) : this.lShiftTo(a, b),
		b
	}
	function bnShiftRight(a) {
		var b = nbi();
		return 0 > a ? this.lShiftTo( - a, b) : this.rShiftTo(a, b),
		b
	}
	function lbit(a) {
		if (0 == a) return - 1;
		var b = 0;
		return 0 == (65535 & a) && (a >>= 16, b += 16),
		0 == (255 & a) && (a >>= 8, b += 8),
		0 == (15 & a) && (a >>= 4, b += 4),
		0 == (3 & a) && (a >>= 2, b += 2),
		0 == (1 & a) && ++b,
		b
	}
	function bnGetLowestSetBit() {
		for (var a = 0; a < this.t; ++a) if (0 != this[a]) return a * this.DB + lbit(this[a]);
		return this.s < 0 ? this.t * this.DB: -1
	}
	function cbit(a) {
		for (var b = 0; 0 != a;) a &= a - 1,
		++b;
		return b
	}
	function bnBitCount() {
		for (var a = 0,
		b = this.s & this.DM,
		c = 0; c < this.t; ++c) a += cbit(this[c] ^ b);
		return a
	}
	function bnTestBit(a) {
		var b = Math.floor(a / this.DB);
		return b >= this.t ? 0 != this.s: 0 != (this[b] & 1 << a % this.DB)
	}
	function bnpChangeBit(a, b) {
		var c = BigInteger.ONE.shiftLeft(a);
		return this.bitwiseTo(c, b, c),
		c
	}
	function bnSetBit(a) {
		return this.changeBit(a, op_or)
	}
	function bnClearBit(a) {
		return this.changeBit(a, op_andnot)
	}
	function bnFlipBit(a) {
		return this.changeBit(a, op_xor)
	}
	function bnpAddTo(a, b) {
		for (var c = 0,
		d = 0,
		e = Math.min(a.t, this.t); e > c;) d += this[c] + a[c],
		b[c++] = d & this.DM,
		d >>= this.DB;
		if (a.t < this.t) {
			for (d += a.s; c < this.t;) d += this[c],
			b[c++] = d & this.DM,
			d >>= this.DB;
			d += this.s
		} else {
			for (d += this.s; c < a.t;) d += a[c],
			b[c++] = d & this.DM,
			d >>= this.DB;
			d += a.s
		}
		b.s = 0 > d ? -1 : 0,
		d > 0 ? b[c++] = d: -1 > d && (b[c++] = this.DV + d),
		b.t = c,
		b.clamp()
	}
	function bnAdd(a) {
		var b = nbi();
		return this.addTo(a, b),
		b
	}
	function bnSubtract(a) {
		var b = nbi();
		return this.subTo(a, b),
		b
	}
	function bnMultiply(a) {
		var b = nbi();
		return this.multiplyTo(a, b),
		b
	}
	function bnSquare() {
		var a = nbi();
		return this.squareTo(a),
		a
	}
	function bnDivide(a) {
		var b = nbi();
		return this.divRemTo(a, b, null),
		b
	}
	function bnRemainder(a) {
		var b = nbi();
		return this.divRemTo(a, null, b),
		b
	}
	function bnDivideAndRemainder(a) {
		var b = nbi(),
		c = nbi();
		return this.divRemTo(a, b, c),
		new Array(b, c)
	}
	function bnpDMultiply(a) {
		this[this.t] = this.am(0, a - 1, this, 0, 0, this.t),
		++this.t,
		this.clamp()
	}
	function bnpDAddOffset(a, b) {
		if (0 != a) {
			for (; this.t <= b;) this[this.t++] = 0;
			for (this[b] += a; this[b] >= this.DV;) this[b] -= this.DV,
			++b >= this.t && (this[this.t++] = 0),
			++this[b]
		}
	}
	function NullExp() {}
	function nNop(a) {
		return a
	}
	function nMulTo(a, b, c) {
		a.multiplyTo(b, c)
	}
	function nSqrTo(a, b) {
		a.squareTo(b)
	}
	function bnPow(a) {
		return this.exp(a, new NullExp)
	}
	function bnpMultiplyLowerTo(a, b, c) {
		var d = Math.min(this.t + a.t, b);
		for (c.s = 0, c.t = d; d > 0;) c[--d] = 0;
		var e;
		for (e = c.t - this.t; e > d; ++d) c[d + this.t] = this.am(0, a[d], c, d, 0, this.t);
		for (e = Math.min(a.t, b); e > d; ++d) this.am(0, a[d], c, d, 0, b - d);
		c.clamp()
	}
	function bnpMultiplyUpperTo(a, b, c) {--b;
		var d = c.t = this.t + a.t - b;
		for (c.s = 0; --d >= 0;) c[d] = 0;
		for (d = Math.max(b - this.t, 0); d < a.t; ++d) c[this.t + d - b] = this.am(b - d, a[d], c, 0, 0, this.t + d - b);
		c.clamp(),
		c.drShiftTo(1, c)
	}
	function Barrett(a) {
		this.r2 = nbi(),
		this.q3 = nbi(),
		BigInteger.ONE.dlShiftTo(2 * a.t, this.r2),
		this.mu = this.r2.divide(a),
		this.m = a
	}
	function barrettConvert(a) {
		if (a.s < 0 || a.t > 2 * this.m.t) return a.mod(this.m);
		if (a.compareTo(this.m) < 0) return a;
		var b = nbi();
		return a.copyTo(b),
		this.reduce(b),
		b
	}
	function barrettRevert(a) {
		return a
	}
	function barrettReduce(a) {
		for (a.drShiftTo(this.m.t - 1, this.r2), a.t > this.m.t + 1 && (a.t = this.m.t + 1, a.clamp()), this.mu.multiplyUpperTo(this.r2, this.m.t + 1, this.q3), this.m.multiplyLowerTo(this.q3, this.m.t + 1, this.r2); a.compareTo(this.r2) < 0;) a.dAddOffset(1, this.m.t + 1);
		for (a.subTo(this.r2, a); a.compareTo(this.m) >= 0;) a.subTo(this.m, a)
	}
	function barrettSqrTo(a, b) {
		a.squareTo(b),
		this.reduce(b)
	}
	function barrettMulTo(a, b, c) {
		a.multiplyTo(b, c),
		this.reduce(c)
	}
	function bnModPow(a, b) {
		var c, d, e = a.bitLength(),
		f = nbv(1);
		if (0 >= e) return f;
		c = 18 > e ? 1 : 48 > e ? 3 : 144 > e ? 4 : 768 > e ? 5 : 6,
		d = 8 > e ? new Classic(b) : b.isEven() ? new Barrett(b) : new Montgomery(b);
		var g = new Array,
		h = 3,
		i = c - 1,
		j = (1 << c) - 1;
		if (g[1] = d.convert(this), c > 1) {
			var k = nbi();
			for (d.sqrTo(g[1], k); j >= h;) g[h] = nbi(),
			d.mulTo(k, g[h - 2], g[h]),
			h += 2
		}
		var l, m, n = a.t - 1,
		o = !0,
		p = nbi();
		for (e = nbits(a[n]) - 1; n >= 0;) {
			for (e >= i ? l = a[n] >> e - i & j: (l = (a[n] & (1 << e + 1) - 1) << i - e, n > 0 && (l |= a[n - 1] >> this.DB + e - i)), h = c; 0 == (1 & l);) l >>= 1,
			--h;
			if ((e -= h) < 0 && (e += this.DB, --n), o) g[l].copyTo(f),
			o = !1;
			else {
				for (; h > 1;) d.sqrTo(f, p),
				d.sqrTo(p, f),
				h -= 2;
				h > 0 ? d.sqrTo(f, p) : (m = f, f = p, p = m),
				d.mulTo(p, g[l], f)
			}
			for (; n >= 0 && 0 == (a[n] & 1 << e);) d.sqrTo(f, p),
			m = f,
			f = p,
			p = m,
			--e < 0 && (e = this.DB - 1, --n)
		}
		return d.revert(f)
	}
	function bnGCD(a) {
		var b = this.s < 0
橘子皮... 2021-02-26
  • 打赏
  • 举报
回复
这玩意花钱就能解决
enaking 2021-02-26
  • 打赏
  • 举报
回复
引用 3 楼 hztltgg 的回复:
一般是c#里直接执行这个js文件。 要找的话,就是在js里找一串私钥字符串,加密方式一般是rsa算法。
我在网上看到了相同的加密代码,后面还有后台代码 https://www.cnblogs.com/CallmeYhz/p/8522679.html 但我调用JsEncryptHelper js = new ImportHelper.JsEncryptHelper(); string strTmp = js.Encrypt(PWD.Text.Trim()); 所得strTmp和抓取的提交的密码并不相同。
enaking 2021-02-26
  • 打赏
  • 举报
回复
自己顶一下。。。。。。。。。。。

111,093

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧