Pwnable/Dreamhack

Dreamhack - SingleByteXor

Lucvs 2022. 10. 19. 23:29
#include <stdio.h>

int main()
{
    char ciphrtext[23] = { 0x54, 0x58, 0x6b, 0x64, 0x58, 0x75, 0x4f, 0x7b, 0x21, 0x5c, 0x7c, 0x75, 0x42, 0x4f, 0x21, 0x63, 0x4f, 0x74, 0x42, 0x75, 0x51, 0x7d, 0x6d };
    char plaintext[23] = { 0x00, };
    
	for (int i = 0; i < 256; i++) {
        for (int k = 0; k < 23; k++) {
    		plaintext[k] = ciphrtext[k] ^ i;   
        }
        
        printf("%s", plaintext);
    }

        
}

Simple XOR Problem