-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcrypt.h
77 lines (67 loc) · 1.61 KB
/
crypt.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#pragma once
#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <cstdlib>
#include <string>
#include <iostream>
#include <list>
#define ALPH_SIZE 32
using namespace std;
class Replacement {
private:
char letterFrom;
char letterTo;
public:
void setParametres(char from, char to);
char getLetFrom(void);
char getLetTo(void);
};
class WordsInfo {
private:
char *word;
int length;
int encrypted;
public:
void setParametres(char *pointer, int len, int encr);
char* getWord();
int getLength(void);
int getEncrypted(void);
};
class Cryptogram {
private:
char *cryptogram;
int cryptogramSize;
public:
Cryptogram();
char* getCryptogram(void);
int getCryptogramSize(void);
void saveCryptogram(void);
};
class CryptoanalyseInstrument {
private:
const string alphabet = "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß";
const string rusLettersDistribution = "îåàèíòñðâëêìäïóÿûüãçá÷éõæøþöùýôú";
string distributionAphabet = "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß";
float frequency[ALPH_SIZE] = { 0 };
int maxLength;
int maxEncrypted;
list<Replacement> replacementList;
list<WordsInfo> wordsInfoList;
Cryptogram myCryptogram;
int menu(void);
void wordsAnalysis(void);
void addNewWordsInfo(char *letters, int length, int encrypted);
void deleteWordsInfo(void);
void addNewReplacement(char letfirst, char letsecond);
public:
CryptoanalyseInstrument();
void mainCicle(void);
void showCryptogram(void);
void showAnalysisResult(void);
void showWordsLength(void);
void showWordsEncrypted(void);
void doReplacement(void);
void showReplacementHistory(void);
void doRollbackFromLastReplacement(void);
void doAutoReplacement(void);
};