Writeup for the Guidepoint 2021 CTF Half crypto challenge
Guidepoint Security CTF 2021 - Half (crypto) For this challenge we get some encoded/encrypted string and the python script that was used to produce it.
3539333437353461373137333532333833333333333933303335333036383639dcb33a3cca39412b58f4095cbc30faf95f72c9c1e71c01aa0a1b0f89c11f03b751dccaa5bb3ec011cc0a40a08ba87827071e1fb52716c891a1263a53af721a18 from Crypto.PublicKey import RSA from Crypto.Cipher import PKCS1_OAEP, AES from Crypto import Random # May be able to get rid of from random import choice, shuffle from OpenSSL import crypto import binascii import base64 pub = crypto.load_publickey(crypto.FILETYPE_PEM, base64.b64decode('LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUF0YmEwY2x2RWllS3A0MUtYaGlpUwpqWnluc2E5RlQzTmpVUE1ZaVBVLzN5L2IySU8zcnFaZmh5RTRCNlAzYXpueDRZMkRoYVVVZFNnN0V5OHJzZ29jCis0dzlIdDYwSTdEWWUxblVKeUt1ekZyTDZESmdxSFR6Sml3SHBCWFNTVnVhaU5KY2NRVXJKMWNaRzdTVG44YmcKbzBCdHNGT0tyVzVzTzNyOGxNWitxWDVldXNZWW9UMDd6U0p5T1V4WVNJcWlwUVpPcEc3Y2JNYVhQZlZaaERDbwpyOW9UVFZaUFA1ZzlqOHNoSmdDVnJLeXE4V2dQTk1sWDRBMVhKQnpIcXFZN2RTK2NZRFhuMmc2dmxOa2RESXpmCjd6U1ZxL0NWZzA1MG1CdXZYdTVWaWVheHhZQnREb0xUQ0JWMmcyYXlOY2pac2tJVmhFbXpvTjNveEd5dFFVNFIKUXdJREFRQUIKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tCg==')) pubkey = crypto.dump_publickey(crypto.FILETYPE_PEM, pub) def random_string(size, chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"): return ''.
Writeup for the Guidepoint 2021 CTF Ssxor crypto challenge
Guidepoint Security CTF 2021 - Ssxor (crypto) For this challenge we get an encrypted string and the python script that was used to generate it:
2e1209315c05627148004b3b46160a565858560a16463b4b00487162055c3109122e import binascii flag = 'StormCTF{Crypto4:blahblahblah}' flag_rev = list(flag[::-1]) stuff = zip(flag, flag_rev) x = lambda x,y: chr(ord(x) ^ ord(y)) out = list() out += [x(s[0],s[1]) for s in stuff] final = [str(b, 'ascii') for b in [binascii.hexlify(bytes(x, 'utf-8')) for x in out]] print(''.join(final)) stuff = zip(flag_rev, out) out = list() out += [x(s[0],s[1]) for s in stuff] print(''.