This repository has been archived by the owner on Dec 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rottor.h
79 lines (70 loc) · 2.62 KB
/
Rottor.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
78
79
#ifndef ROTTOR_H_INCLUDED
#define ROTTOR_H_INCLUDED
class Rottor
{
private:
int Key; //stores the key
int RottorNo; //Number of Rotto in Engima
char* AlphaArray; //stores the address of alphabets array
char* TempArray;
int Count;
int TempCount;
public:
Rottor();
Rottor(int k,char* a,int RNo, int fff); //parameterized constructor
int GetPositionA(char ch);
int GetPositionT(char ch);
char GetCharA(int no);
char GetCharT(int no);
void Rotate(int time,bool Dir);
void SetRottor();
char Encrypt(char ch);
// char DeCrypt(char ch);
~Rottor(); //destructorv
/* Description of GetPosition
Functionality
It returns the index number of any char passed to it as argument in TempArray
Working
It takes the char from TempArray compare it with entered char until it find match and then returns the index number
*/
/* Description of GetChar
Functionality
It returns the char present at the index which is passed to it as argument in AlphaArray
Working
It only returns the char at that index in AlphaArray
*/
/* Description of SetRottor
Functionality
SetRottor Function actually set the rotor accordingly to the Key(present in the private part of the class)
Working
It determine the number of rotations using Key and than rotate the TempArray and set the array
*/
/* Description of Encrypt Function
Functionality
It Takes char and Encrypt it and returns the Encrypted char
Working
*/
/* Description of DeCrypt Function
Functionality
It Takes char and DeCrypt it and returns the De-Crypted char
Working
*/
/* Description of Rotate
Functionality
It can rotate TempArray in clockwise & Anti-clockwise by n times
Working
*/
//Rotate function can rotate left or right
/* Description of Rottor
Functionality
Constructor Default
Working
*/
//Default constructor
/* Description of parameterized
Functionality
It creates the object,create the copy of the entered array,initial set the TempArray according to the key
Working
*/
};
#endif // ROTTOR_H_INCLUDED