data是一个BufferSource对象,不能直接是要加密的字符串。结果是一个ArrayBuffer,可以使用window.btoa(String.fromCharCode(newUint,rray(e)))输出为base,符串解密crypto.subtle.decrypt(algorithm,key,data),基本同加密,这边data对应为加密返回的ArrayBuffer,如果是base。安装:npminstallcrypto-js–save在utils文件夹中新建secret.js文件,内容:message:需要加解密的文本key:加解密的秘钥iv:偏移量,最短,数,ecb模式不需要此参数在vue页面引入secret。
$iv);$encrypted=openssl_encrypt($data,

感谢您的来访,获取更多精彩文章请收藏本站。

© 版权声明
THE END
暂无评论内容