小程序
小游戏
企业微信
微信支付
扫描小程序码分享
提供了1124的进入场景,但启动参数要怎么设置?P.URL.CN/0P$M%LZ4LHSVSDCR2L2 我只有这个信息啊?????难道要我填
code_ticket
???
2 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
这边想了解下这里调试一物一码的场景,需要启动参数做什么哈?
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
请问下,我们这边使用java 解密二维码数据,提示下面这个错误,能分享下您这边解密二维码的流程和代码吗?感谢
function
jiemi(body) {
var
iv =
'vrZI0rRZJ85PFLVS'
// 一物一码的秘钥
clearEncoding =
'utf8'
cipherEncoding =
'base64'
key =
cipherChunks = []
decipher = crypto.createDecipheriv(
'aes-128-cbc'
, key, iv)
cipherChunks.push(decipher.update(body, cipherEncoding, clearEncoding))
cipherChunks.push(decipher.final(clearEncoding))
decryption = cipherChunks.join(
''
)
return
decryption
}
let content = jsonfile.readFileSync(file)
let bitmap = content.buffer;
let jie = jiemi(bitmap)
console.log(jie)
fs.writeFileSync(
'data.txt'
, jie);
Java:
public
void
jiemi(
byte
[] buffer, String key, String iv)
throws
Exception {
[] keyBytes = Base64.decodeBase64(key.getBytes(
"UTF-8"
));
int
base =
16
;
if
(keyBytes.length % base !=
0
) {
groups = keyBytes.length / base + (keyBytes.length % base !=
?
1
:
);
[] temp =
new
[groups * base];
Arrays.fill(temp, (
System.arraycopy(keyBytes,
, temp,
, keyBytes.length);
keyBytes = temp;
[] encrypted1 = Base64.decodeBase64(buffer);
//先用base64解密
Security.addProvider(
BouncyCastleProvider());
SecretKeySpec secretKeySpec =
SecretKeySpec(keyBytes,
"AES"
Cipher cipher = Cipher.getInstance(
"AES/CBC/PKCS7Padding"
,
"BC"
IvParameterSpec ivP =
IvParameterSpec(iv.getBytes(
(StringUtils.isEmpty(iv)) {
cipher.init(Cipher.DECRYPT_MODE, secretKeySpec);
else
{
cipher.init(Cipher.DECRYPT_MODE, secretKeySpec, ivP);
[] result = cipher.doFinal(encrypted1);
System.out.println(
String(result));
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
这边想了解下这里调试一物一码的场景,需要启动参数做什么哈?
请问下,我们这边使用java 解密二维码数据,提示下面这个错误,能分享下您这边解密二维码的流程和代码吗?感谢
function
jiemi(body) {
var
iv =
'vrZI0rRZJ85PFLVS'
// 一物一码的秘钥
var
clearEncoding =
'utf8'
var
cipherEncoding =
'base64'
var
key =
'vrZI0rRZJ85PFLVS'
var
cipherChunks = []
var
decipher = crypto.createDecipheriv(
'aes-128-cbc'
, key, iv)
cipherChunks.push(decipher.update(body, cipherEncoding, clearEncoding))
cipherChunks.push(decipher.final(clearEncoding))
var
decryption = cipherChunks.join(
''
)
return
decryption
}
let content = jsonfile.readFileSync(file)
let bitmap = content.buffer;
let jie = jiemi(bitmap)
console.log(jie)
fs.writeFileSync(
'data.txt'
, jie);
Java:
public
void
jiemi(
byte
[] buffer, String key, String iv)
throws
Exception {
byte
[] keyBytes = Base64.decodeBase64(key.getBytes(
"UTF-8"
));
int
base =
16
;
if
(keyBytes.length % base !=
0
) {
int
groups = keyBytes.length / base + (keyBytes.length % base !=
0
?
1
:
0
);
byte
[] temp =
new
byte
[groups * base];
Arrays.fill(temp, (
byte
)
0
);
System.arraycopy(keyBytes,
0
, temp,
0
, keyBytes.length);
keyBytes = temp;
}
byte
[] encrypted1 = Base64.decodeBase64(buffer);
//先用base64解密
Security.addProvider(
new
BouncyCastleProvider());
SecretKeySpec secretKeySpec =
new
SecretKeySpec(keyBytes,
"AES"
);
Cipher cipher = Cipher.getInstance(
"AES/CBC/PKCS7Padding"
,
"BC"
);
IvParameterSpec ivP =
new
IvParameterSpec(iv.getBytes(
"UTF-8"
));
if
(StringUtils.isEmpty(iv)) {
cipher.init(Cipher.DECRYPT_MODE, secretKeySpec);
}
else
{
cipher.init(Cipher.DECRYPT_MODE, secretKeySpec, ivP);
}
byte
[] result = cipher.doFinal(encrypted1);
System.out.println(
new
String(result));
}