Selasa, 21 Juni 2011

Encryption and Description

Encryption is a process safety of a hidden data or data conversion process (plaintext) into a form that can not be read / understood. While Decryption is the reverse of the encryption process is the process of converting data that is encrypted (ciphertext) back into the original data (plaintext Original) so it can be read / understood again.
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;
}

This is the view after the writing on the Dev C + +:
 

0 komentar:

Posting Komentar