3 * \file CryptographicEncryption.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
12 #ifndef CRYPTOCRAPHIC_ENCYPTION_H
13 #define CRYPTOCRAPHIC_ENCYPTION_H
15 #include <QCryptographicHash>
21 class CryptographicEncryption
24 CryptographicEncryption();
31 bool encyrpt(QByteArray const & plain, QByteArray * encrypted, QByteArray const & key);
32 bool decyrpt(QByteArray const & encrypted, QByteArray * plain, QByteArray const & key);
34 QByteArray bytesToKey(QByteArray const &);
35 QByteArray stringToKey(QString const &);
38 int blockAlign(int blockSize, QByteArray& bytes);
39 int blockDealign(QByteArray& bytes);
40 QByteArray hash(QByteArray const & bytes, QCryptographicHash::Algorithm);
41 bool aesEnryption(QByteArray const & in, QByteArray* out, QByteArray const & key, bool encrypt);