You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hyp-front/src/api/sm4.js

16 lines
327 B

const sm4 =require('sm-crypto').sm4
//const key='7f5cd501e5548914edaed6824d3ff79d'//可以为16进制串或字节数组要求为128比特
/**
* 加密
* @param txt
* @returns {*}
*/
export function encrypt(txt,key) {
return sm4.encrypt(txt,key);
}
export function decrypt(txt,key) {
return sm4.decrypt(txt,key);
}