//从文件中读取出内容
QFile file("D:\\testMod\\Toolpath\\top-mark2-1.900");
if (!file.open(QFile::ReadOnly | QFile::Text))
return 0;
QByteArray ba = file.readAll();//文件内容
file.close();
Encrypt*pEncrypt = Encrypt::getInstance(); //获取加密单例
QByteArray outEncryptBa; //加密后的
QByteArray outUncryptBa; //解密后的
pEncrypt->InitializePrivateKey(16, "abc"); //初始化密钥
pEncrypt->OnAesEncrypt(ba, outEncryptBa); //加密
pEncrypt->OnAesUncrypt(outEncryptBa, outUncryptBa);//解密
1