Messages that are encrypted plaintext which is exemplified called plaintext (P), the encryption process is exemplified encryption (E), let's say the decryption process of decryption (D), and the message is called ciphertext which is exemplified encrypted ciphertext (C)
This is the sourcecode:
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
char p1, c1, hasil, plain;
int key;
cout<<"\tII**********************************************II\n";
cout<<"\tII Program untuk Mencari Enkripsi dan Deskripsi II\n";
cout<<"\tII II\n";
cout<<"\tII**********************************************II\n";
cout<<"\n";
for (int i=1; i<=128; i++){
key=1;
hasil=i;
cout<<i<<"="<<hasil<<endl;
}
cout<<"masukkan kata :";
cin>>plain;
cout<<"masukkan niali key :";
cin>>key;
p1 = (plain+key)%128;
c1 = (plain-key)%128;
cout<<"hasil enkripsi :"<<p1<<endl;
cout<<"hasil deskripsi :"<<c1<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
char p1, c1, hasil, plain;
int key;
cout<<"\tII**********************************************II\n";
cout<<"\tII Program untuk Mencari Enkripsi dan Deskripsi II\n";
cout<<"\tII II\n";
cout<<"\tII**********************************************II\n";
cout<<"\n";
for (int i=1; i<=128; i++){
key=1;
hasil=i;
cout<<i<<"="<<hasil<<endl;
}
cout<<"masukkan kata :";
cin>>plain;
cout<<"masukkan niali key :";
cin>>key;
p1 = (plain+key)%128;
c1 = (plain-key)%128;
cout<<"hasil enkripsi :"<<p1<<endl;
cout<<"hasil deskripsi :"<<c1<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}
0 komentar:
Posting Komentar