const Encrypt  = require('./MD5.js')

// 密钥对生成 http://web.chacuo.net/netrsakeypair

const publicKey = 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3GsBgHY/2MChxQf03WVYlaUWSmj3vCgYUiVS45Y3hLq2x7Yo/YvQOI5FnROESRbfxdg5WaKLbzPDrCiTt82PBd47kXnOn40ieli7tE7Ug1VNE7QQ5I2DTFmdiBkCQErTZidmboUF264FVzCW3UpP7UsElqIM2QEUx60XkIkxybxLbJx6L9qcv0Zd23F+BjGlmoOHkr8hcgu00c2RUY3UrJYXznDAydomiWWSOCplGG9xoAOJ0C/zphscqBPGIMrmaKnMA7QQzSZL/tvAT/CbbKmVgIHlXWDdn1T6qbCP00A21hrh/lB/yOZ+DGFowDruTztwWyi+8Rmm5zwgFquofwIDAQAB'

// const privateKey = ''

// 加密
export function encrypt(txt) {
  const encryptor = new Encrypt.JSEncrypt()
  encryptor.setPublicKey(publicKey) // 设置公钥
  return encryptor.encrypt(txt) // 对数据进行加密
}

// 解密
// export function decrypt(txt) {
//   const encryptor = new JSEncrypt()
//   encryptor.setPrivateKey(privateKey) // 设置私钥
//   return encryptor.decrypt(txt) // 对数据进行解密
// }

