Jumat, 11 Desember 2009

ini dia programnya,,.^

#include
#include
#include
#include

int a,b,c,d,e,f,g,h,i,j,k,k1,k2,z,n,m;
char KS[30], SCTR[30], kunci[40];
char abjad[26]="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
char temp[30], numpang, KCTR[30], P[1000],C[1000];
int X[1000],Y[1000],K[26];
int Z[26]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25};

void mbagi(int m)
{ if(m%2==0) printf("\nparameter anda genap!!");
else if(m==13) printf("\nparameter anda 13!!");
else if(m==1) z=1; else if(m==3) z=9;
else if(m==5) z=21; else if(m==7) z=15;
else if(m==9) z=3; else if(m==11) z=19;
else if(m==15) z=7; else if(m==17) z=23;
else if(m==19) z=11; else if(m==21) z=5;
else if(m==23) z=17; else if(m==25) z=25;
}


void masukin_kunci()
{
printf("\n\n\n\n\n\n");
printf("\n =====================================\n");
printf(" >> masukkan kunci : ");
scanf("%s",kunci); strupr(kunci);
printf("\n =====================================\n");
}

void ngilangin_huruf()
{ n=strlen(kunci);
c=0;
for(i=n-1;i>0;i--)
for(j=i-1;j>=0;j--)
if(kunci[i]==kunci[j])
kunci[i]='0';
a=0;
for(i=0;itemp[j+1])
{ numpang=temp[j+1];
temp[j+1]=temp[j];
temp[j]=numpang;
}
k=0;
for(i=0;i> Ciphertextnya : ");

for (i=0;i> Ciphertextnya : ");

m=a; mbagi(m);
for (i=0;i> Ciphertextnya : ");

for (i=0;i> Ciphertextnya : ");

m=a*d-b*c; mbagi(m);
for (i=0;i> Ciphertextnya : ");

for (i=0;i> Ciphertextnya : ");

m = ((a*e*k) + (b*f*g) + (c*d*h) - (c*e*g) - (b*d*k) - (a*f*h))%26;
if (m<0) m = m+26; mbagi(m); for (i=0;i>>>......]]");
printf("\n [[---------------------------------------------]]");
printf("\n [[ 1. Monographic ]]");
printf("\n [[ 2. Digraphic ]]");
printf("\n [[ 3. Trigraphic ]]");
printf("\n [[=============================================]]");
printf("\n [[=============================================]]");
printf("\n mo pilih mana : ");
scanf("%i",&pilih);

switch(pilih)
{ case 1 : mbuka_mono(); break;
case 2 : mbuka_di(); break;
case 3 : mbuka_tri(); break;
}
}


void sistem_nyandi()
{ int pilih;clrscr();

printf("\n\n\n\n\n\n");
printf("\n [[=============================================]]");
printf("\n [[=============================================]]");
printf("\n [[.....<<<< MENU NYANDI SISTEM HIILS >>>>......]]");
printf("\n [[---------------------------------------------]]");
printf("\n [[ 1. Monographic ]]");
printf("\n [[ 2. Digraphic ]]");
printf("\n [[ 3. Trigraphic ]]");
printf("\n [[=============================================]]");
printf("\n [[=============================================]]");
printf("\n mo pilih mana : ");
scanf("%i",&pilih);

switch(pilih)
{ case 1 : nyandi_mono(); break;
case 2 : nyandi_di(); break;
case 3 : nyandi_tri(); break;
}
}

void key()
{ int pilih;clrscr();
printf("\n\n\n\n\n\n");
printf("\n [[=============================================]]");
printf("\n [[=============================================]]");
printf("\n [[..........<<<< MENU KUNCI MIX >>>>...........]]");
printf("\n [[---------------------------------------------]]");
printf("\n [[ 1. Mix KS ]]");
printf("\n [[ 2. Mix SCTR ]]");
printf("\n [[ 3. Mix KCTR ]]");
printf("\n [[=============================================]]");
printf("\n [[=============================================]]");
printf("\n mo pilih mana : ");
scanf("%i",&pilih);

switch(pilih)
{ case 1 :
ks(); for (i=0;i<26;i++) K[i]=KS[i]; break; case 2 : sctr(); for (i=0;i<26;i++) K[i]=SCTR[i]; break; case 3 : kctr(); for (i=0;i<26;i++) K[i]=KCTR[i]; break; } } void main() { int pilih; clrscr(); printf("\n\n\n\n\n\n"); printf("\n [[=============================================]]"); printf("\n [[=============================================]]"); printf("\n [[.............<<<< MENU UTAMA >>>>............]]");
printf("\n [[---------------------------------------------]]");
printf("\n [[ 1. Nyandi ]]");
printf("\n [[ 2. Mbuka ]]");
printf("\n [[ 3. Keluar ]]");
printf("\n [[=============================================]]");
printf("\n [[=============================================]]");
printf("\n mo pilih mana : ");
scanf("%i",&pilih);

switch(pilih)
{ case 1 : sistem_nyandi(); break;
case 2 : sistem_mbuka(); break;
case 3 : break;
}
getch();
}


Tidak ada komentar:

Posting Komentar

terima kasi yah
madridista89

Daftar Blog Saya

Entri Populer