add xmasspirit solve

This commit is contained in:
aaron
2021-12-04 01:44:49 +01:00
parent 935da1c9cd
commit 6a66280e54
4 changed files with 73 additions and 10 deletions

View File

@@ -9,4 +9,24 @@ letter?
## Flag
HTB{4ff1n3_c1ph3r_15_51mpl3_m47h5}
- See letter.pdf
## How to solve
See `decrypt.py`
## Progress
### Code analysis:
- Choose a `randint` `a` from `1` to `mod`, that is not divisible by mod.
- Choose a `randint` `b` from `1` to `mod`.
- for each byte in `dt`
- calculate `(a * byte + b) % mod`
- append to output bytes
- return bytes when done
### Notes
- `s_next = (a * s_prev + b) mod p` is a linear congruential generator