Credentials_manager/PasswordManager/cryptographer.h
2021-12-25 08:56:38 +03:00

39 lines
969 B
C++

#ifndef CRYPTOGRAPHER_H
#define CRYPTOGRAPHER_H
#include <QString>
#include <QtGui>
//#include <simplecrypt.h>
//#include <QtCrypto>
#include <crypto++/aes.h>
#include <crypto++/modes.h>
#include <crypto++/filters.h>
#include <crypto++/hex.h>
#include <crypto++/sha.h>
#include <crypto++/md5.h>
class Cryptographer
{
public:
Cryptographer(QString key);
Cryptographer();
QString encrypt(QString message);
QString decrypt(QString message);
private:
QString key;
// SimpleCrypt *crypto; //some random number
long int encryptedText[100];
long int decryptedText[100];
long int p, q, t, e, d, n;
bool isPrime(long int prime);
long int calculateE( long int t );
long int greatestCommonDivisor( long int e, long int t );
long int calculateD( long int e, long int t );
long int encrypt( long int i, long int e, long int n );
long int decrypt(long int i, long int d, long int n );
};
#endif // CRYPTOGRAPHER_H