forensics/whitepages

This commit is contained in:
Oystein Kristoffer Tveit 2024-09-03 18:48:23 +02:00
parent 0fec7de96a
commit 4c40d47aa5
Signed by: oysteikt
GPG Key ID: 9F2F7D8250F35146
2 changed files with 23 additions and 0 deletions

22
forensics/whitepages/solve.py Executable file
View File

@ -0,0 +1,22 @@
#!/usr/bin/env python3
import binascii
with open('whitepages.txt') as file:
content = file.read()
bits = []
for ws in content:
if ws == ' ':
bits.append(1)
else:
bits.append(0)
def chunks(l, n):
for i in range(0, len(l), n):
yield l[i:i + n]
for byte in chunks(bits, 8):
bitstring = ''.join(str(bit) for bit in byte)
i = int(bitstring, 2)
print(chr(i), end='')

View File

@ -0,0 +1 @@