|

楼主 |
发表于 2025-2-9 11:54:00
|
显示全部楼层
不是刻意在。而是我实际工作中要用到。
45587222x558966622
这是我在开发加密算法时。服务端和客户端不匹配。我想看一下它的真实值。
以下是代码部分
- const res = await response.json();
- const { salt, b_pub } = res.data;
- const salt_bits = sjcl.codec.hex.toBits(salt);// 将 salt 的 hex 字符串转为 bits
- const b_pub_bits = sjcl.codec.hex.toBits(b_pub);// 将 b_pub 的 hex 字符串转为 bits
- const identity_hash_bits = computeIdentityHash(username, password);
- const x_bits = computeX(salt_bits, identity_hash_bits);
- const x_hex = sjcl.codec.hex.fromBits(x_bits);
- const x_bn = new BigInteger(x_hex, 16);
复制代码 |
|