update writeup

This commit is contained in:
aaron
2021-12-04 05:20:50 +01:00
parent 1bad194a14
commit f5e3af5326

View File

@@ -43,11 +43,11 @@ def get_factors(ct:bytes, n:int=256) -> (int, int):
- When the factors are found, simply create a lookup table of all values and substitute each byte in the ciphertext.
```python
def decrypt(ct:bytes) -> bytes:
def decrypt(ct:bytes, lut:dict) -> bytes:
''' decrypt the file using the lookup table '''
res = b''
for byte in ct:
dec = lookup[byte]
dec = lut[byte]
res += bytes([dec])
return res
```