From e8e8d7c865ad363737c37eaeeb00529f06e3903e Mon Sep 17 00:00:00 2001 From: aaron Date: Sat, 4 Dec 2021 04:48:22 +0100 Subject: [PATCH] update readme --- crypto/XMASSpirit/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto/XMASSpirit/README.md b/crypto/XMASSpirit/README.md index 73188f9..ce4cb8e 100644 --- a/crypto/XMASSpirit/README.md +++ b/crypto/XMASSpirit/README.md @@ -24,7 +24,7 @@ HTB{4ff1n3_c1ph3r_15_51mpl3_m47h5} - So it's possible to attack the encryption by iterating and trying to create a pair (a, b) that matches the entire encrypted pdf header. ```python -def get_factors(ct, n=256): +def get_factors(ct:bytes, n:int=256) -> (int, int): ''' find a and b for n and ct ''' # first generate a list of all numbers without common divisor with 256 nogcds = [ x for x in range(1, n) if gcd(x, n) == 1 ] @@ -43,7 +43,7 @@ def get_factors(ct, n=256): - When the factors are found, simply create a lookup table of all values and substitute each byte in the ciphertext. ```python -def decrypt(ct): +def decrypt(ct:bytes) -> bytes: ''' decrypt the file using the lookup table ''' res = b'' for byte in ct: