Hello again,
I must confess, I discovered a very serious flaw in my code yesterday. Please do make the following changes : Declare k[56] as k[64], and instead of accepting a 56-bit key, run the for loop to accept a 64-bit key. Refer to the code pasted by frz and go to the line where I have commented "Converting the 64-bit key to 56-bit key".The for loop should be :
for(i=0;i<64;i++)
k1[i]=k[i];
now that k[] and k1[] are both 64-bit arrays.
It was like this originally,but I made this change some months after the main program,thinking that Iwould have to enter only 56 bits instead of the 64 bits earlier,and conveniently forgetting about the compression permutation that converts the 64-bit key to the 56-bit key !!! But even after this flaw having gone unnoticed, I never got any garbage values. Hence it was undetected until yesterday when I sat down to understand my own code to post the working of the functions .
I am profusely sorry to those who have downloaded this code,and those who have used it. I allow myself a famous frustration vent "DOH!!" (courtesy--Homer Simpson) .
I am again sorry,considering the response it has got,and especially to those who ran it.
Thank you.
P.S. I "DOH!!" once again....