前后端加密的方法
1. nodejs自带的crypto
const crypto = require('crypto');
function aesEncrypt(data, key) {
const cipher = crypto.createCipher('aes192', key);
var crypted = cipher.update(data, 'utf8', 'hex');
crypted += cipher.final('hex');
return crypted;
}
f
原创
2021-10-06 09:54:56 ·
2118 阅读 ·
0 评论