-
Notifications
You must be signed in to change notification settings - Fork 0
/
cryptohelper.h
51 lines (45 loc) · 1.41 KB
/
cryptohelper.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef CRYPTOHELPER_H
#define CRYPTOHELPER_H
#include <QObject>
#include <QWidget>
#include <QString>
#include <qmath.h>
#include <QPushButton>
class CryptoHelper : public QObject
{
Q_OBJECT
public:
explicit CryptoHelper(QObject *parent = 0);
static QString pre(QString text);
static QString preW(QString text);
static QString post(QString text);
static bool isUniq(QString text);
static QString leftRotate(QString text, int count);
static QString rightRotate(QString text, int count);
static QPair<int, int> tableSize(int alphabetLength);
static void setAlphabet(QString alphabet);
static QString alphabet;
static QString extAlphabet;
static int tokenLength;
static Qt::GlobalColor tableColor;
static Qt::GlobalColor inCharsColor;
static Qt::GlobalColor outCharsColor;
static Qt::GlobalColor arrowColor;
static int interval;
};
class AbstractCipher : public QWidget
{
Q_OBJECT
public:
explicit AbstractCipher(QWidget *parent = 0);
public slots:
virtual void encryptText();
signals:
void encryptedText(QString str);
void text(QString text);
void results(QString inText, QString outText);
void results(QString alphabet, QString inText, QString outText);
void results(QString table1, QString table2, QString inText, QString outText);
void results(QVector<int> square, QString inText, QString outText);
};
#endif // CRYPTOHELPER_H