| 377 | } |
| 378 | |
| 379 | bool WizAESEncryptToString(const unsigned char* cipher, \ |
| 380 | const QByteArray& inStr, QByteArray& outStr) |
| 381 | { |
| 382 | QBuffer ibuf, obuf; |
| 383 | ibuf.setData(inStr); |
| 384 | |
| 385 | if (!ibuf.open(QIODevice::ReadOnly) || !obuf.open(QIODevice::ReadWrite)) { |
| 386 | TOLOG("Can't open buffer"); |
| 387 | return false; |
| 388 | } |
| 389 | |
| 390 | QDataStream is(&ibuf), os(&obuf); |
| 391 | |
| 392 | if (!simpleAESEncrypt(cipher, &is, &os)) { |
| 393 | TOLOG("AES decrypt failed"); |
| 394 | return false; |
| 395 | } |
| 396 | |
| 397 | outStr.clear(); |
| 398 | outStr.append(obuf.buffer()); |
| 399 | return true; |
| 400 | } |
| 401 | |
| 402 | bool WizAESEncryptStringToBase64String(const QString& password, \ |
| 403 | const QString& inStr, QString& outBase64Str) |
no test coverage detected