Warning: main(topsc.html) [function.main]: failed to open stream: No such file or directory in /home/eng123/public_html/sourcecode/c/unix/crytography.html on line 13

Warning: main(topsc.html) [function.main]: failed to open stream: No such file or directory in /home/eng123/public_html/sourcecode/c/unix/crytography.html on line 13

Warning: main() [function.include]: Failed opening 'topsc.html' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/eng123/public_html/sourcecode/c/unix/crytography.html on line 13


Warning: main(leftsc.html) [function.main]: failed to open stream: No such file or directory in /home/eng123/public_html/sourcecode/c/unix/crytography.html on line 16

Warning: main(leftsc.html) [function.main]: failed to open stream: No such file or directory in /home/eng123/public_html/sourcecode/c/unix/crytography.html on line 16

Warning: main() [function.include]: Failed opening 'leftsc.html' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/eng123/public_html/sourcecode/c/unix/crytography.html on line 16

Displaying  Source Code(s)  
 


Warning: main(adsc.html) [function.main]: failed to open stream: No such file or directory in /home/eng123/public_html/sourcecode/c/unix/crytography.html on line 31

Warning: main(adsc.html) [function.main]: failed to open stream: No such file or directory in /home/eng123/public_html/sourcecode/c/unix/crytography.html on line 31

Warning: main() [function.include]: Failed opening 'adsc.html' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/eng123/public_html/sourcecode/c/unix/crytography.html on line 31

 
cryptography in c on linux

--------------------------------------------------------------------------------

Description : This program takes a text file from guest file and encrypts it.to retain the original text redo the same code.you can make the algorithm more abstruse.try it.for example as key ,which here is taken as i=i+2.you can take a song(dat file) converted to text file.or you can first invert the source text then encrypt.



#include<stdio.h>
int main()
{unsigned long int i=0;
char ch;
char name1[20],name2[20];
FILE *fp,*ft;
printf("ENTER THE SOURCE FILE:");
gets(name1);
printf("ENTER THE DESTINATION FILE:");
gets(name2);
fp=fopen(name1,"r");
ft=fopen(name2,"w");
if(fp==NULL)
{printf("CAN,T OPEN THE FILE");
}
while(!feof(fp))
{ch=getc(fp);
ch=~((ch^i));
i+=2;
if(i==100000)
{i=0;
}
putc(ch,ft);
}
fclose(fp);
fclose(ft);
return 0;
}

 

 

Contribute content or training reports / feedback / Comments
job placement papers
All rights reserved © copyright 123ENG