Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- char key[20] = { 0x87, 0xff, 0x63, 0xa3, 0x8d, 0x75, 0xd8, 0xc4, 0x1a, 0x84, 0xca, 0x24, 0x5b, 0x66, 0x0c, 0x1f, 0xc6, 0xe2, 0xcc, 0xea };
- FILE *fileptr;
- char *buffer;
- long filelen;
- fileptr = fopen("flag.enc", "rb");
- fseek(fileptr, 0, SEEK_END);
- filelen = ftell(fileptr);
- rewind(fileptr);
- buffer = (char *)malloc((filelen+1)*sizeof(char));
- fread(buffer, filelen, 1, fileptr);
- fclose(fileptr);
- int i;
- for(i = 0; i < filelen; i++) {
- if( i != 0 && i % 20 == 0 )
- printf("\n");
- printf("%c", buffer[i] ^ key[i%20]);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement