Residue class enumeration given partial information of either end.
Project description
enumer
Residue class enumeration given partial information of either end.
Example:
# Python
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'))
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.
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.0.tar.gz
(6.0 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.0.tar.gz.
File metadata
- Download URL: enumer-0.1.0.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9fe1dcbda452fba101a84cb92317267e9375ae4369abb18bf3cbc3e3bae1d80
|
|
| MD5 |
99f855c08702d6aa0a96097292e9ac02
|
|
| BLAKE2b-256 |
c30b17ae58a4b76f5c18a0f091757c21a34beed37566f9770e1d77c86e024705
|
File details
Details for the file enumer-0.1.0-py3-none-any.whl.
File metadata
- Download URL: enumer-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.6 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 |
5f32d826ed3a3a0eadc034bde85b19e14ef4c128ec43ed78fbcb96234e351792
|
|
| MD5 |
cffd2077281296968d4622cb03ec5938
|
|
| BLAKE2b-256 |
063e0e74c6bdbb2416c10d35607e92a2000e82a4bdcbcbfd3840d87a96ab3dde
|