Exemplo n.º 1
0
QString SimpleCrypt::decryptToString(QByteArray cypher)
{
    QByteArray ba = decryptToByteArray(cypher);
    QString plaintext = QString::fromUtf8(ba, ba.size());

    return plaintext;
}
Exemplo n.º 2
0
QByteArray SimpleCrypt::decryptToByteArray(const QString& cyphertext)
{
    QByteArray cyphertextArray = QByteArray::fromBase64(cyphertext.toAscii());
    QByteArray ba = decryptToByteArray(cyphertextArray);

    return ba;
}
Exemplo n.º 3
0
QString SimpleCrypt::decryptToString(const QString &cyphertext){
  QByteArray cyphertextArray = QByteArray::fromBase64(cyphertext.toAscii());
  QByteArray plaintextArray = decryptToByteArray(cyphertextArray);
  QString plaintext = QString::fromUtf8(plaintextArray, plaintextArray.size());

  return plaintext;
}