Created
May 17, 2020 07:26
-
-
Save okumurakengo/1a48c3690008c47f54855bb82a422371 to your computer and use it in GitHub Desktop.
c言語で排他的論理和を使って超簡単に暗号化、複合化
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SLHFNLM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int main(int argc, char *argv[]) | |
{ | |
FILE *infile, *outfile; | |
int ch; | |
int key = 3; | |
infile = fopen(argv[1], "rb"); | |
outfile = fopen(argv[2], "wb"); | |
while ((ch = fgetc(infile)) != EOF) { | |
putc(ch ^ key, outfile); | |
printf("%d %d\n", ch, ch ^ key); | |
} | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POKEMON |
Author
okumurakengo
commented
May 17, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment