-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathACVR.h
More file actions
77 lines (58 loc) · 1.72 KB
/
ACVR.h
File metadata and controls
77 lines (58 loc) · 1.72 KB
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
#ifndef ACVR_ENDECODER_ACVR_H
#define ACVR_ENDECODER_ACVR_H
#include <string>
#include <utility>
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <windows.h>
#include <conio.h>
using std::string, std::cout, std::cin, std::size, std::vector, std::to_string, std::any_of;
#define NonNumAlpha "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
#define ValidAlpha "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz+%|/=_-{}[];:.><,)(*&?^$#@!"
#define RSAdecrypt "1234567890 "
#define Alpha "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
#define RevAlpha "ZYXWVUTSRQPONMLKJIHGFEDCBA"
#define OnlyNums "1234567890"
// ACVR.cpp
void to_upper(string & str);
void to_valid(string & str);
unsigned long gcd_recursive(unsigned a, unsigned b);
bool isPrime(int a);
vector<string> split(string str, string delimiter);
int modExp(int a, int b, int n);
int modinv(int u, int v);
string input(string Alphabet, int n);
int int_check(string str);
// Atbash.cpp
class Atbash {
public:
static string encode(string Message);
static string decode(string Message);
};
// Caesar.cpp
class Caesar {
public:
static string encode(string Message, int n);
static string decode(string Message);
};
// Vigenere.cpp
class Vigenere {
private:
static void size_match(string & str, const string& str1);
public:
static string encode(string Message, string Key);
static string decode(string Message, string Key);
};
// RSA.cpp
class RSA {
private:
static int calc_d(int e, int fi);
static int calc_e(int fi);
static int reverse_calc_e(int fi);
public:
static string encode(string Message, int p, int q);
static string decode(const string& Message, int d, int n);
};
#endif //ACVR_ENDECODER_ACVR_H