Rabu, 28 September 2016

Program C++ untuk Enkripsi Algoritma RSA dengan CRT


#include <iostream.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <conio.h>
#include <stdio.h>

long int p,q,n,r,t,i,s,flag,e[100],d[100],temp[100],j,m[100],en[100],x,y;
char kata[100];
int prime(long int);
void ce();
long int cd(long int);
void encrypt();
int hitmod(int a,int b,int n);
int phi(int n);
int GCD(int x,int y);

void main()
{cout<<":::::::::::::::::::Chinese Remainder Theorem:::::::::::::::::::"<<endl<<endl;
 cout<<"\n Masukkan bilangan prima p : ";
 cin>>p;
 flag=prime(p);
  if(flag == 0)
  {cout<<"\n inputan anda salah \n";
   exit(1); }