Press "Enter" to skip to content

[VXCTF2017] One Native Pad

Question

Given an python script and two images.

ONP.py

outimg1.png

outimg2.png

Solution

To xor two images. I found that one of the image are cry frog.

So, i found the original image in google.

Now is the time to study how the script do the encryption

Formula: encPixel = curPixel xor k

Now we have encPixel and curPixel. So we can recover K with this formula: k[index] = encPixel(x,y) ^ curPixel(x,y).

After execute this script i get two image.

It seems there are some wire pixel inside these two image. My idea is to use the original image compare with outimg1Solve.png to extract the only wire pixel. Then i can use the wire pixel to compare with outimg2Solve.png
wirePixel:

compare result:

Comments

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *