2 This file has been derived from Konversation, the KDE IRC client.
3 You can redistribute it and/or modify it under the terms of the
4 GNU General Public License as published by the Free Software Foundation;
5 either version 2 of the License, or (at your option) any later version.
9 Copyright (C) 1997 Robey Pointer <robeypointer@gmail.com>
10 Copyright (C) 2005 Ismail Donmez <ismail@kde.org>
11 Copyright (C) 2009 Travis McHenry <tmchenryaz@cox.net>
12 Copyright (C) 2009 Johannes Huber <johu@gmx.de>
24 explicit Cipher(QByteArray key, QString cipherType = QString("blowfish"));
26 QByteArray decrypt(QByteArray cipher);
27 QByteArray decryptTopic(QByteArray cipher);
28 bool encrypt(QByteArray &cipher);
29 QByteArray initKeyExchange();
30 QByteArray parseInitKeyX(QByteArray key);
31 bool parseFinishKeyX(QByteArray key);
32 bool setKey(QByteArray key);
33 QByteArray key() { return m_key; }
34 bool setType(const QString &type);
35 QString type() { return m_type; }
36 static bool neededFeaturesAvailable();
37 inline bool usesCBC() { return m_cbc; }
40 //direction is true for encrypt, false for decrypt
41 QByteArray blowfishCBC(QByteArray cipherText, bool direction);
42 QByteArray blowfishECB(QByteArray cipherText, bool direction);
43 QByteArray b64ToByte(QByteArray text);
44 QByteArray byteToB64(QByteArray text);
46 QCA::Initializer init;
48 QCA::DHPrivateKey m_tempKey;
49 QCA::BigInteger m_primeNum;