收藏
回答

DES解密出错

问题类型 插件 AppID 插件版本号 AppID 操作系统 微信版本 基础库版本
Bug wxf25d506ff81e19fb 0.0.002 wxd184b44392380aab Android 调试工具中 2.3.0

- 当前 Bug 的表现(可附上截图)

执行crypto.TripleDES().decrypt 时,出现下面错误:

VM5902:1 URIError: URI malformed

    at decodeURIComponent (<anonymous>)

    at Function.value (appservice.js:984)

    at toString (appservice.js:984)

    at t.onShow (binded.js? [sm]:123)

    at t.<anonymous> (WAService.js:19)

    at Xt (WAService.js:20)

    at sn (WAService.js:20)

    at un (WAService.js:20)

    at Function.<anonymous> (WAService.js:20)

    at L.<anonymous> (WAService.js:19)



- 提供一个最简复现 Demo

const mi = new crypto.TripleDES().encrypt('0000000', "1111111", {

iv: 8,

mode: crypto.Mode['CBC'],

padding: crypto.Padding['NoPadding']

});

console.log('encrypt:', mi.toString());


var str = mi.toString();


const v = new crypto.TripleDES().decrypt(str, "1111111", {

iv: 8,

mode: crypto.Mode['CBC'],

padding: crypto.Padding['NoPadding']

});

console.log('decrypt:', v.toString(crypto.Utf8));

console.log('');


回答关注问题邀请回答
收藏

1 个回答

  • One




.
    One .
    2018-10-08

    这种模式下不能为NoPadding


    2018-10-08
    有用
    回复
登录 后发表内容