Dat 10 - lshift(c lshift(d for(i=0;i<28;i cd[i]=c[i cd[i...

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
16,7,27,20,13,2, 41,52,31,37,47,55, 30,40,51,45,33,48, 44,49,39,56,34,53, 46,42,50,36,29,32}; static int nls[17] = { 0,1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1}; static int cd[56],keyb[64]; static int cnt,n=0; register int i,j; for(i=0;i<8;i++) /*Read in key*/ for(j=0;j<8;j++) keyb[n++]=(key[i]>>j&0x01); for(i=0;i<56;i++) /*Permuted choice 1*/ cd[i]=keyb[pc1[1]-1]; for(i=0;i<28;i++){ c[i]=cd[i]; d[i]=cd[i+28]; } for(cnt=1;cnt<=16;cnt++){ for(i=0;i<nls[cnt];i++){
Image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: lshift(c); lshift(d); } for(i=0;i<28;i++){ cd[i]=c[i]; cd[i+28]=d[i]; } for(i=0;i<48;i++) /*Permuted Choice 2*/ keyout[cnt][i]=cd[pc2[i]-1]; } } static void lshift(unsigned char shft){ register int temp,i; temp=shft[0]; for(i=0;i<27;i++) shft[i]=shft[i+1]; shft[27]=temp; } static void cypher(int *r, int cnt, int *fout){ static int expand[48],b[8][6],sout[8],pin[48];...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern