import cryptoJs from "crypto-js";
function decryptDes(message, key = "com.template.common.utils") {
  var keyHex = cryptoJs.enc.Utf8.parse(key);
  var decrypted = cryptoJs.DES.decrypt(
    {
      ciphertext: cryptoJs.enc.Base64.parse(message),
    },
    keyHex,
    {
      mode: cryptoJs.mode.ECB,
      padding: cryptoJs.pad.Pkcs7,
    }
  );
  return decrypted.toString(cryptoJs.enc.Utf8);
}
// des解密 message为需要解密的信息  key为密钥
export default {
  decryptDes,
};
