update writeup
This commit is contained in:
@@ -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
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user