-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDecrypt.h
76 lines (70 loc) · 1.44 KB
/
Decrypt.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
#pragma once
#include "stdafx.h"
#include <stdio.h>
#include <cstdlib>
#include <Windows.h> // use < > for all system and library headers
#include <winuser.h>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <complex>
#include <string>
using namespace std;
void decryptionbone() {
key = "";
cryptChar = 0;
ifstream readeree("bone.txt");
if (!readeree) {
cout << "Error opening bone.txt";
}
else {
for (int i = 0; !readeree.eof(); i++) {
readeree.get(letter);
key += letter;
}
readeree.close();
}
cryptMessage += "*";
key.pop_back();
while (cryptMessage[cryptChar] != '*') {
keyChar = 0;
while (uncyrptable[keyChar] != '_') {
if (cryptMessage[cryptChar] == key[keyChar]) { // also for caps
cryptMessage[cryptChar] = uncyrptable[keyChar];
keyChar = 67;
}
keyChar++;
}
cryptChar++;
}
cryptMessage.pop_back();
}
void decryptionbtwo() {
cryptChar = 0;
key = "";
ifstream readere("btwo.txt");
if (!readere) {
cout << "Error opening name.txt";
}
else {
for (int i = 0; !readere.eof(); i++) {
readere.get(letter);
key += letter;
}
readere.close();
}
cryptMessage += "*";
key.pop_back();
while (cryptMessage[cryptChar] != '*') {
keyChar = 0;
while (uncyrptable[keyChar] != '_') {
if (cryptMessage[cryptChar] == key[keyChar]) { // also for caps
cryptMessage[cryptChar] = uncyrptable[keyChar];
keyChar = 67;
}
keyChar++;
}
cryptChar++;
}
cryptMessage.pop_back();
}