More Than Meets the Eye
Zero-width space (ZWSP)

Problem

My friend just sent me this file, but it looks pretty empty. Are you able to see anything?

Solution

Opening up the file in a hex editor, we can see that the "empty space" is essentially repetitions of either E280 8BE2 808C or E280 8CE2 808C.
We can convert this to binary where E280 8BE2 808C -> 0 and E280 8CE2 808C -> 1.
1
from Crypto.Util.number import *
2
​
3
with open('zwsp.txt', 'rb') as f:
4
data = f.read()
5
​
6
i = 0
7
curr = []
8
​
9
bin_string = ''
10
​
11
for char in data:
12
if char not in b'Pretty empty over here':
13
i += 1
14
curr.append(char)
15
if i % 3 == 0:
16
i = 0
17
print(curr)
18
​
19
if curr[-1] == 139:
20
bin_string += '0'
21
else:
22
bin_string += '1'
23
​
24
curr = []
25
​
26
print(bin_string)
27
print(int(bin_string, 2))
28
print(long_to_bytes(int(bin_string, 2)))
Copied!
Copy link