4 int main(int argc
, char *argv
[])
7 //char sfkey[128] sfin[128], sfout[128];
8 if (argc
<= 1 || argc
> 4 ) { printf("Usage: crypt key [in] [out]\n"); return 1; }
9 FILE* fkey
= fopen(argv
[1], "rb"); //Open Key
10 if (argc
>= 3) { freopen(argv
[2], "rb", stdin
); } //Reopen stdin
11 if (argc
== 4) { freopen(argv
[3], "wb", stdout
); } //Reopen stdout
13 while( (i
= getchar()) != EOF
) {
14 if ( (k
= getc(fkey
)) == EOF
)
15 { fseek(fkey
, 0L, SEEK_SET
); k
= getc(fkey
); }
16 //printf("%d: %c\n", k, k); sleep(1); //Debug
This page took 1.004343 seconds and 4 git commands to generate.