Doxygen Source Code Documentation
hide.c File Reference
#include <stdio.h>#include <string.h>#include <stdlib.h>Go to the source code of this file.
| Functions | |
| int | main (int argc, char *argv[]) | 
Function Documentation
| 
 | ||||||||||||
| \** File : SUMA.c 
 Input paramters : 
 
 
 Definition at line 5 of file hide.c. References argc, key, and putchar. 
 00006 {
00007    int nkey , ikey ;
00008    unsigned char *key ;
00009    int chin , chout ;
00010 
00011    if( argc < 2 || strncmp(argv[1],"-help",5) == 0 ){
00012       fprintf(stderr,"Usage: hide key < input > output\n") ;
00013       exit(1) ;
00014    }
00015 
00016    key = (unsigned char *) argv[1] ; nkey = strlen(argv[1]) ;
00017    if( nkey < 1 ){ fprintf(stderr,"Illegal key\n") ; exit(1) ; }
00018 
00019    ikey = 0 ;
00020    do{
00021       chin = getchar() ; if( chin == EOF ) break ;
00022       chout = ((unsigned char)chin) ^ key[ikey++] ;
00023       putchar(chout) ;
00024       ikey = ikey % nkey ;
00025    } while(1) ;
00026 
00027    exit(0) ;
00028 }
 | 
 
                             
                             
                             
                             
                             
                             
                             
                             
                             
                             
                             
                             
 
 
 
 
       
	   
	   
	   
	  