/* * Program Name :: Noise Encryptor/Decryptor * Author Name :: DATA_Noise * Organization :: Underground Systems * Email :: DATA_Noiseundergroundsystems.org * Website :: http://www.undergroundsystems.org/ * Compile :: bash$ gcc -o noise noise.c */ #include #include static char *progname[] = { "NOISE", "noise.c", "DATA_Noise2003" }; int main(int argc, char *argv[]) { FILE *fpin; FILE *fpout; int count; int bytes; if (argc != 4) { printf("Simple Noise Encryptor/Decryptor\n"); printf("Usage: %s \n", argv[0]); printf("Sample: %s Text.txt Text.noise s3cr3t\n", argv[0]); exit(-1); } if ((fpin = fopen(argv[1], "rb")) == NULL) { perror("fopen() failed"); exit(-1); } if ((fpout = fopen(argv[2], "wb")) == NULL) { perror("fopen() failed"); exit(-1); } while ((count = getc(fpin)) != EOF) { count = count ^ *argv[3]; bytes++; putc(count, fpout); } fclose(fpin); fclose(fpout); printf("Encrypted %s and stored data in %s\n", argv[1], argv[2]); printf("Wrote %d bytes to %s\n", bytes, argv[2]); return 0; }