Tags: crypto 

Rating: 5.0

#400 - My Game

>Letters intertwined
>The end, recombined.
>Awake, lying blinking,
>Intensely thinking.
>Muse and proclaim...
>“It’s my game!”

>?HLJ1>AA"AII>888!CE9>AA>"~>IIG888BAA~@>d>B~B?HH0bAI>>AE&>IIAACMQa

#Solution

After examining the words in the problem, we took the first letters of each word and found that they spelled out `LITERALBITMAPIMG`
A bitmap image is essentially just a grid of pixels, so we then thought about how to convert the string they gave us into a bitmap. There are 65 characters in the string. If we use each individual character as a pixel, it would come out to be a 5x13 image, which isn't big enough to have a flag. So we convert the string to binary!
Using (http://www.asciitohex.com/) we converted the ascii to binary and wrote a python script to construct a 8x65 bitmap.

```python
from PIL import Image

bits = "00111111 01001000 01001100 01001010 00110001 00111110 01000001 01000001 00100010 01000001 01001001 01001001 00111110 00111000 00111000 00111000 00100001 01000011 01000101 00111001 00111110 01000001 01000001 00111110 00100010 01111110 00111110 01001001 01001001 01000111 00111000 00111000 00111000 01000010 01000001 01000001 01111110 01000000 00111110 01100100 00111110 01000010 01111110 01000010 00111111 01001000 01001000 00110000 01100010 01000001 01001001 00111110 00111110 01000001 01000101 00100110 00111110 01001001 01001001 01000001 01000001 01000011 01001101 01010001 01100001"
bits = bits.replace(" ", "")
x = 8
y = 65
img = Image.new("RGB", (x, y), "white")
for i in range(y):
for a in range(x):
if (bits[a + (i * x)] == "1"):
img.putpixel((a, i), (0, 0, 0))

img.save("flag.jpg")
```

![](https://github.com/Alaska47/RC3CTF-2016-Writeups/blob/master/crypto/400-My-Game/flag.PNG)

After playing around with the x and y variables which specify the width and height of the bitmap image created, we found that creating a vertical 8x65 image gave us the flag, although we had to invert the image and rotate it.

#Flag

>RC3-2016-JAIP3GEZ

Original writeup (https://github.com/Alaska47/RC3CTF-2016-Writeups/tree/master/crypto/400-My-Game).