
// import { sm4 } from 'sm-crypto'
import { sm4 } from 'gm-crypt'
import { getSM4} from '@/utils/auth';
import { passwords} from '@/store/modules/password';
import { secrets} from '@/utils/secret';
let SM4Data = {
  key: passwords() + getSM4() + secrets(),
  mode:"ecb",
 cipherType: 'base64',
}

// 加密
export function encrypt(txt:string) {
 const sm4Util =  new sm4(SM4Data)
  return sm4Util.encrypt(txt, SM4Data.key)
}

// // 解密
export function decrypt(txt:string) {
  // const encryptor = new JSEncrypt()
  // encryptor.setPrivateKey(privateKey)
  // return encryptor.decrypt(txt)
}

