Skip to content

Instantly share code, notes, and snippets.

@volpino volpino/solve.c
Created Dec 7, 2014

Embed
What would you like to do?
SECCON 2014 - crypto200
#include <stdio.h>
int main(int argc, char** argv)
{
signed int result;
unsigned int seed;
FILE *input_file;
FILE *output_file;
char buf;
if ( argc > 2 )
{
seed = atoi(argv[3]);
srand(seed);
input_file = fopen(argv[1], "rb");
output_file = fopen(argv[2], "wb");
while ( fread(&buf, 1, 1, input_file) == 1 )
{
buf ^= rand();
fwrite(&buf, 1, 1, output_file);
}
fclose(input_file);
fclose(output_file);
result = 0;
}
else
{
result = 1;
}
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.