Added experimental makepkg-update-checksums.sh
[mirrors/Programs.git] / c / crypt / crypt.c
1 #include <stdio.h>
2 #include <stdlib.h>
3
4 int main(int argc, char *argv[])
5 {
6 int k, i; //Key, In,
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
12
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
17 putchar(i^k);
18 }
19 return 0;
20 }
This page took 1.5127 seconds and 4 git commands to generate.