Cipher Programs

30
/* * Type: Monoalphabetic Substitution Cipher * Caesar Cipher */ #include <iostream> #include <conio.h> #include<stdlib.h> #include<string> using namespace std; class CaesarCipher pri!ate: static const int " $ % & ; // the 'ey (or caesar cipher public: string encryption )string str string str+ % ,, ; (or )int i%- ; i<str.length) ; i int % ) ) )) int str0i1 2 34 "$ 5 +3 34 ; str+ % ) char ; 6 return str+ ; 6 string decryption )string str string str+ % ,, ; (or )int i%- ; i<str.length) ; i int % ) ) )) int str0i1 2 34 2 " $ 5 +3 ; % ) <- 7 )+32 abs) : ; str+ % ) char 34 ; 6 return str+ ; 6 6; int menu ) ; int main) CaesarCipher caesar ; bool state % true ; 8hile )state s8itch ) menu) case 9: cout << , n nter The lain Te t : n, ; string str ; char ch ; 8hile ) )ch%getche) % = r=

description

using c++

Transcript of Cipher Programs

/** Type: Monoalphabetic Substitution Cipher * Caesar Cipher*/ #include #include #include#includeusing namespace std;

class CaesarCipher{ private: static const int KEY = 3 ; // the key for caesar cipher public: string encryption (string str) { string str2 = "" ; for (int i=0 ; i