1. Cyber Sea Game 2017: addcrypto (50)

    We are given a file, encrypt.py, which looks as follows.

    import os
    from flag import flag
    
    message = os.urandom(8) + flag
    
    cipher = ''
    for i in range(0, len(message) - 1):
        cipher += chr((ord(message[i]) + ord(message[i+1]) + ord(message[i+1])) & 0xff)
    
    print cipher.encode('hex')
    # 4c8f7236c7b259b4e9b792929f2d59534437394530392a2547645958522d3d3b4e3e412c2f2a47314b604d483849342534413e516673 …
    read more
  2. MeePwn CTF 2017: |\/|/-\T|-| (100)

    We are given a file, hack.py, which looks as follows.

    from Crypto.Util.number import *
    from hashlib import md5
    
    flag = "XXX"
    assert len(flag) == 4
    pad = bytes_to_long(md5(flag).digest())
    
    hack = 0
    
    for char in flag:
        hack+= pad
        hack*= ord(char)
    
    print hack
    print pad
    print hack % pad
    #hack …
    read more

page 1 / 1