سبحان الله و بحمده سبحان الله العظيم ❤️
← BACK TO WRITEUPSServer: nc mercury.picoctf.net 19354
The server provides a randomly generated 36-character alphabet, encrypts a message using a 6×6 Playfair variant, and expects decryption. The plaintext doesn't follow standard picoCTF{...} format.
def decrypt_pair(pair, matrix): p1 = get_index(pair[0], matrix) p2 = get_index(pair[1], matrix) if p1[0] == p2[0]: # Same row - shift left return matrix[p1[0]][(p1[1]-1) % 6] + \ matrix[p2[0]][(p2[1]-1) % 6] elif p1[1] == p2[1]: # Same column - shift up return matrix[(p1[0]-1) % 6][p1[1]] + \ matrix[(p2[0]-1) % 6][p2[1]] else: # Rectangle - swap columns return matrix[p1[0]][p2[1]] + matrix[p2[0]][p1[1]]