Spikey Elf @ HXP 38C3 CTF

Happy new year! Here is a writeup for the challenge Spikey Elf from the 38C3 CTF by HXP. The Challenge We are given the following code: #!/usr/bin/env sage proof . all ( False ) bits = 1024 errs = 16 p = random_prime ( 2 ^ ( bits // 2 )) q = random_prime ( 2 ^ ( bits // 2 )) n = p * q e = 0x10001 print ( f ' { n = : #x } ' ) print ( f ' { e = : #x } ' ) flag = pow ( int . from_bytes ( open (…