Residue class enumeration given partial information of either end.
Project description
enumer
Residue class enumeration given partial information of either end.
Getting Started
- pip
pip install enumer
- Clone the repo
git clone https://github.com/Cosmic-Excalibur/enumer.git
Features
enumer. Perform naive enumerations of representatives.tail_enumer. With the last few bits specified. This is done by simple modular arithmetic.head_tail_enumer. With both the last and first few bits specified. This is done by meet-in-the-middle tricks.
Examples
from secret import secret_message_from_someone
from enumer import *
# E
secret_message = secret_message_from_someone.encode('utf-8')
assert secret_message.startswith(b'Merry Christmas~~~~~~~~~~~~~~~~~~~~')
assert secret_message.endswith(b'padoru padoru!!!!!!!!!!!!!!!!!!!!!!!')
assert len(secret_message) == 191
flag = b2l(secret_message)
mod = int('1337133713371337133713371337133713371337133713371337'
'1337133713371337133713371337133713371337133713371337'
'1337133713371337133713371337133713371337133713371337'
'1337133713371337133713371337133713371337133713371337'
'1337133713371337133713371337133713371337133713371337'
'13371337133713371337133713371337133713371337000', 16)
ct = flag % mod
# ct = 0xfcad5e7f12e0fd8a5e8038e0fea85e80031e5e7f06e0fc9a5e7f29
# e0fd865e7f01e0fca89be0fca25e7f08e0fcbd5e7f2ae0fd875e80
# 0d1e5e810ce0fe875e8126e0fe8f5e8104e0fea89b45dc70e366ed
# 629b70ea6fe476ea1de65ef562e96c9b76ea72e9669b71ee72e666
# e866e35eed5f3fd20de055822dd862875ed34cce60f11a9d1a9d1a
# 9d1a9d1a9d1a9d1a9d1a9d1a9d1a3ebd0121
# D
head = b'Merry Christmas~~~~~~~~~~~~~~~~~~~~'
tail = b'padoru padoru!!!!!!!!!!!!!!!!!!!!!!!'
length = 191
for pt in head_tail_enumer(ct, mod, head, tail, length, size_limit = 15000):
if pt == flag:
print(l2b(pt).decode('utf-8'))
For more examples, refer to enumer/test.
from enumer import run_enumer_tests
run_enumer_tests()
And...
- Merry Xmas 🎄🧑🎄
Merry Ymas 🎄🧑🎄Merry Zmas 🎄🧑🎄
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
enumer-0.1.3.tar.gz
(8.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file enumer-0.1.3.tar.gz.
File metadata
- Download URL: enumer-0.1.3.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6a803953121067758d521b3d8a58981f7efbdd6e6b190cea0c3c1036e3533d4
|
|
| MD5 |
ba4053c1f33ce2721ac871b80f0d0de0
|
|
| BLAKE2b-256 |
b6926d1085f24d5e71217621648250d9362a1a30925b51d7982bfe8b52f0a0e6
|
File details
Details for the file enumer-0.1.3-py3-none-any.whl.
File metadata
- Download URL: enumer-0.1.3-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0aeaff49073a91242c137b45828bcb9a72ed058088d9538c9fc810d61fbd522
|
|
| MD5 |
1ca67f1d4e9faf15dd7c6a80d5d718fe
|
|
| BLAKE2b-256 |
d1e45eff21dda0eab1de2496a5d13c22e3d2141f86e3bda2d4fd27099e717e2e
|