import CryptoJS from 'crypto-js'
export function decryptAes(params) {
  try {
    const key = CryptoJS.enc.Utf8.parse('fa4e0fae59534676') // 16 bytes key for AES

    const bytes = CryptoJS.AES.decrypt(params.info, key, {
      mode: CryptoJS.mode.ECB,
      padding: CryptoJS.pad.Pkcs7
    })
    const decryptedtext = bytes.toString(CryptoJS.enc.Utf8)
    return JSON.parse(decryptedtext)
  } catch (e) {
    console.info(e)
  }
}
