Need to patch the python binding in https://github.com/Chia-Network/bls-signatures
- javascript:alert(origin)
- @maple3142
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from sage.all import * | |
| import random | |
| from pwn import * | |
| def well512(state_with_idx): | |
| state, index = state_with_idx | |
| a = state[index] | |
| c = state[(index + 13) & 15] | |
| b = a ^ c ^ (a << 16) ^ (c << 15) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from sage.all import crt, lcm, reduce | |
| from Crypto.Util.number import * | |
| import csv | |
| # fmt: off | |
| pico_r = [3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547] | |
| # fmt: on | |
| def solve_eqs(eqs): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from sage.all import crt, lcm, reduce | |
| from Crypto.Util.number import * | |
| # fmt: off | |
| pico_r = [3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283] | |
| # fmt: on | |
| def solve_eqs(eqs): | |
| if len(eqs) < 2: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from binteger import Bin | |
| import sys | |
| sys.setrecursionlimit(10000) | |
| mask = int("55" * 128, 16) << 1 | |
| n = 27827431791848080510562137781647062324705519074578573542080709104213290885384138112622589204213039784586739531100900121818773231746353628701496871262808779177634066307811340728596967443136248066021733132197733950698309054408992256119278475934840426097782450035074949407003770020982281271016621089217842433829236239812065860591373247969334485969558679735740571326071758317172261557282013095697983483074361658192130930535327572516432407351968014347094777815311598324897654188279810868213771660240365442631965923595072542164009330360016248531635617943805455233362064406931834698027641363345541747316319322362708173430359 | |
| e = 65537 | |
| c = 8879262206679688908793239933227510574535053292824641211921666616686529884723922008336172633568024007865308291986303381324610408548172400458622311631920664068648537784408785822654664172271858326202541370427938566262449889250480881111190046078900257634145087538952254926231933115599220847964 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| from Crypto.Util.number import bytes_to_long, getPrime, isPrime | |
| flag = os.environ.get("FLAG", "fakeflag").encode() | |
| while True: | |
| p = getPrime(1024) | |
| q = (p << 512 | p >> 512) & (2**1024 - 1) # bitwise rotation (cf. https://en.wikipedia.org/wiki/Bitwise_operation#Rotate) | |
| if isPrime(q): break |
conda create --name ctf sage=10.5 -c conda-forge
pip install web3 pwntools numpy z3-solver httpx fastecdsa pytesseract pyshark flask-unsign flask-unsign[wordlist] binteger websockets pycryptodome ecdsa black gunicorn websockets waitress git-dumper ptrlib gunicorn[gevent] ropper tqdm flask r2pipe PyExifTool python-docx pillow numpy pycurl galois networkx pyshark gradient-free-optimizers bottle playwright
# also try z3-solver==4.11.2.0 which could be faster
# with more ml stuffs:
conda create --name ctf sage=10.2 -c conda-forge scikit-learn pandas pytorch matplotlib torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
# not supported by Python 3.11
# pip install cvc5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def poly_sub(f, x, y): | |
| ret = f.parent().zero() | |
| for c, m in f: | |
| while m % x == 0: | |
| m //= x | |
| c *= y | |
| ret += c * m | |
| return ret | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from subprocess import check_output, DEVNULL, CalledProcessError | |
| import itertools | |
| import IPython | |
| import time | |
| def to_fplll_format(M): | |
| m, n = M.dimensions() | |
| ret = "" | |
| s = "[" |