CoCalc Public FilesCrypto_Fall_20 / Projects / proj3 / xor.cOpen with one click!
Author: Ayushi Shah
Views : 16
Compute Environment: Ubuntu 20.04 (Default)
1
#include <stdio.h>
2
#include <stdlib.h>
3
4
int main(int argc, char* argv[])
5
{
6
char* file1 = argv[1];
7
char* file2 = argv[2];
8
FILE* fp1 = fopen(file1,"r");
9
FILE* fp2 = fopen(file2,"r");
10
int c1 = getc(fp1);
11
int c2 = getc(fp2);
12
while((c1 != EOF) && (c2 != EOF))
13
{
14
int c3 = c1^c2;
15
fputc(c3,stdout);
16
c1 = getc(fp1);
17
c2 = getc(fp2);
18
19
}
20
fclose(fp1);
21
fclose(fp2);
22
}
23
24