Skip to content
This repository has been archived by the owner on Aug 15, 2023. It is now read-only.

Latest commit

 

History

History
41 lines (30 loc) · 855 Bytes

Warmup.md

File metadata and controls

41 lines (30 loc) · 855 Bytes

Warmup

A fun visual cryptogr aphy tool will amaze your kids!


题目中给出了两张灰度图ciphered_message.pngsecret.png,先用PIL看一下图片中每个像素点的值,发现均为0或255.

from PIL import Image
im = Image.open('ciphered_message.png')
print(list(im.getdata()))

使用PIL合并两张图片即可.

from PIL import Image

im = Image.open('ciphered_message.png')
im2 = Image.open('secret.png')
assert im.size == im2.size
size = im2.size
print(size)
print(im.mode)
data = [x for x in im.getdata()]
for index,x in enumerate(im2.getdata()):
    if x and data[index]:
        data[index] = 255
    else:
        data[index] = 0

im = Image.new('1',size)
im.putdata(data)
im.save('ans.png')

TMUCTF

flag:TMUCTF{W3_h0p3_y0u_3nj0y_7h15_c0mp371710n_4nd_7h4nk_y0u!}