Professional Documents
Culture Documents
//Group members:
//Kathryn Ann G. Florentino
//Merilyn L. Paguigan
//Arnold Gatan
//Chammy Malenab
#include<iostream>
#include<string.h>
void encryptyfunc()
{
char text[100];
char group;
int k, key;
cout <<"*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*\n";
cout <<"\nEnter a message of Plaintext: ";
cin >>text;
cout <<"*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*\n";
cout <<"\nEnter Secret key: ";
cin >> key;
text[k] = group;
}
text[k] = group;
BSIT-3A
}
}
cout <<"*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*\n";
cout << "\nThe Encrypt message: " << text <<endl;
cout <<"*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*\n";
}
void decryptfunc()
{
char text[100];
char group;
int k, key;
cout <<"*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*\n";
cout <<"\nEnter a message of Ciphertext: ";
cin >>text;
cout <<"*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*\n";
cout <<"\nEnter Secret key: ";
cin >> key;
text[k] = group;
}
text[k] = group;
}
}
cout <<"*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*\n";
cout << "\nThe Decrypt message: " <<text <<endl ;
cout <<"*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*\n";
}
int main()
{
jump:
BSIT-3A
int choice;
cout<<endl;
cout <<" *~>Caesar Cipher<~*\n";
cout <<"*-------------------------------------------*\n";
cout << "| Press ~> 1 Encryption |";
cout << "\n| Press ~> 2 Decryption |"<<endl;
cout <<"*-------------------------------------------*\n";
cout << endl;
cout << "Choose one of Caesar Cipher: ";
cin >> choice;
switch(choice)
{
case 1: encryptyfunc();
break;
case 2: decryptfunc();
break;
default:
cout <<"\n*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*\n";
cout << " You entered are Invalid!";
cout <<"\n*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*\n";
break;
}
char c;
cout << "\nDo you want run more [y/n]: ";
cin >> c;
if (c == 'n')
{
cout <<"Thank You!";
return 0;
}
else if (c == 'y')
{
goto jump;
}
}
BSIT-3A
Output:
Entered number 1 and 2
If entered unmentioned
BSIT-3A
GROUP MEMBERS:
Kathryn Ann Florentino
Merilyn Paguigan
Arnold Gatan
Chammy Malenab