Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- int main(int argc, char **argv){
- FILE *in,
- *out;
- char *key;
- int c,
- len;
- if(argc != 4){
- printf("Usage: %s [input file] [output file] [encryption key]", *argv);
- return 1;
- }
- in = fopen(argv[1], "r");
- out = fopen(argv[2], "w");
- key = argv[3];
- len = strlen(key);
- while( (c = fgetc(in)) != EOF){
- fputc(c ^ *key, out);
- key = key == argv[3] + len ? argv[3] : key + 1;
- }
- fclose(in);
- fclose(out);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement