X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcipher.h;h=2cd808608f0d641576ef7ea10d7f0143eb51ce8e;hp=b5cf0e0f345c64fcbb5ee3b8500712b2dc9b68a9;hb=3972e140226f32760bb2606650f93132c188b2dc;hpb=6f0a153a674317d77233139fc50a2985af86e36e diff --git a/src/core/cipher.h b/src/core/cipher.h index b5cf0e0f..2cd80860 100644 --- a/src/core/cipher.h +++ b/src/core/cipher.h @@ -15,17 +15,17 @@ #ifndef CIPHER_H #define CIPHER_H -#include +#include class Cipher { - public: +public: Cipher(); - explicit Cipher(QByteArray key, QString cipherType=QString("blowfish")); + explicit Cipher(QByteArray key, QString cipherType = QString("blowfish")); ~Cipher(); QByteArray decrypt(QByteArray cipher); QByteArray decryptTopic(QByteArray cipher); - bool encrypt(QByteArray& cipher); + bool encrypt(QByteArray &cipher); QByteArray initKeyExchange(); QByteArray parseInitKeyX(QByteArray key); bool parseFinishKeyX(QByteArray key); @@ -33,8 +33,10 @@ class Cipher QByteArray key() { return m_key; } bool setType(const QString &type); QString type() { return m_type; } + static bool neededFeaturesAvailable(); + inline bool usesCBC() { return m_cbc; } - private: +private: //direction is true for encrypt, false for decrypt QByteArray blowfishCBC(QByteArray cipherText, bool direction); QByteArray blowfishECB(QByteArray cipherText, bool direction); @@ -48,4 +50,6 @@ class Cipher QString m_type; bool m_cbc; }; + + #endif // CIPHER_H