office-encryption
SRC: https://library.m0unt41n.ch/challenges/office-encryptionThanks xNull for making a solveable crypto challenge <3
Sooo its substitution cipher and luckily we got the ranomly generated sbox provided. We have to invert the map, v -> key and key -> value and copy paste the substitution logic. uwu print flag thanks
Python:
map = {'a': 'k', 'b': 'n', 'c': 'o', 'd': 'r', 'e': 'v', 'f': 'q', 'g': 'i', 'h': 'w', 'i': 'x', 'j': 'd', 'k': 'h', 'l': 'm', 'm': 'l', 'n': 'y', 'o': 'u', 'p': 'b', 'q': 'f', 'r': 'p', 's': 's', 't': 'z', 'u': 't', 'v': 'a', 'w': 'c', 'x': 'j', 'y': 'g', 'z': 'e'}
alphabet = "abcdefghijklmnopqrstuvwxyz"
cipher = "swo2024{jytmm_ruvs_opgbzu_mum}"
rev_map = {v: k for k, v in map.items()}
decrypted_flag = ""
for char in cipher:
if char.lower() in rev_map:
encrypted_char = rev_map[char.lower()]
if char.isupper():
encrypted_char = encrypted_char.upper()
decrypted_flag += encrypted_char
else:
decrypted_flag += char
print(decrypted_flag)