import * as CryptoJS from 'crypto-js'

/**
 * @param {Object} word解密
 */
export function bnsCloudDecrypt(word) {
  var key = CryptoJS.enc.Utf8.parse('bonus@cloud@2025')
  var decrypt = CryptoJS.AES.decrypt(word, key, { mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7 })
  return CryptoJS.enc.Utf8.stringify(decrypt).toString()
}

/**
 * @param {Object} word加密
 */
function bnsCloudEncrypt(word) {
  var key = CryptoJS.enc.Utf8.parse('bonus@cloud@2025')
  var srcs = CryptoJS.enc.Utf8.parse(word)
  var encrypted = CryptoJS.AES.encrypt(srcs, key, { mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7 })
  return encrypted.toString()
}


