[/MNT/AIN LIB] [CRYPTO] locksmith

locksmith​

SRC: https://library.m0unt41n.ch/challenges/locksmith

This chall provided a binary (could also be a remote), and it basically performed a encryption onto a password which was required too reverse. Every minute it changed.. It was a substituion / ceasar cipher... and based on the minute it choose a different ROT. So i wrote a script which just pritned all rots xD

Python:
def rotate(text: str, shift: int) -> str:
    result = []
    for c in text:
        if 'A' <= c <= 'Z':
            base = ord('A')
            result.append(chr((ord(c) - base - shift) % 26 + base))
        elif 'a' <= c <= 'z':
            base = ord('a')
            result.append(chr((ord(c) - base - shift) % 26 + base))
        else:
            result.append(c)
    return ''.join(result)

if __name__ == "__main__":
    ct = input("Cipher‑Text eingeben: ").strip()
    for shift in range(26):
        pt = rotate(ct, shift)
        if "key" in pt.lower():
            print(f"ROT‑{shift:2d}: {pt}")

Use the found password (just some animal names starting with a Key) and obtain the flag from the binary.
 
Back
Top