ctrモード

CONFidence CTF 2019 Teaser|Count me in!

#CONFidenceCTF2019Teaser https://ctftime.org/task/7838 中には count.py と output.txtがある import multiprocessing from Crypto.Cipher import AES from secret import key, flag counter = 0 aes = AES.new(key, AES.MODE_ECB) def chunk(input_data,…

ALLES! CTF 2021 | Secure Flag Service

#alles_ctf_2021 #!/usr/bin/env python3 import base64 from Crypto.Cipher import AES from Crypto.Hash import SHA3_256, HMAC, BLAKE2s from Crypto.Random import urandom, random # from secret import FLAG, PASSWORD # from secret import FLAG, PAS…

redpwn CTf 2021 | yahtzee

#redpwnctf2021 #!/usr/local/bin/python from Crypto.Cipher import AES from Crypto.Util.number import long_to_bytes from random import randint from binascii import hexlify with open('flag.txt','r') as f: flag = f.read().strip() with open('ke…

HackIM 2020 | ayyMessage

#AES #CTRモード #!/usr/bin/env python3 from Crypto.PublicKey import RSA, ECC import json from hashlib import sha256 from Crypto.Cipher import AES, PKCS1_OAEP from base64 import b64decode from Crypto.Signature import DSS from Crypto.Hash im…

corCTF 2021 | babypad

#corctf2021 from Crypto.Cipher import AES from Crypto.Util import Counter from Crypto.Util.Padding import pad, unpad from Crypto.Util.number import bytes_to_long import os flag = open("/challenge/flag.txt").read().encode() key = os.urandom…