Category: Cryptography
A type of transposition cipher is the rail fence cipher, which is described here1. Here is one such cipher encrypted using the rail fence with 4 rails.
Can you decrypt it?
Download the message here1.local
Put the decoded message in the picoCTF flag format, picoCTF{decoded_message}.
Found this python script to encode and decode rail fence https://www.geeksforgeeks.org/rail-fence-cipher-encryption-decryption/
I changed the driver code in the program to decode our flag:
# Driver code
if __name__ == "__main__":
# Now decryption of the
# same cipher-text
print(decryptRailFence("Ta _7N6DDEhlg:W3D_H3C31N__883ef sHR053F38N43D1B i33___ND", 4))
running it with our message.txt we get:
└─$ python3 ./railfenceCipher.py
The flag is: WH3R3_D035_7H3_F3NC3_8361N_4ND_3ND_D81DB8E3
Putting it in picoCTF{} format:
picoCTF{WH3R3_D035_7H3_F3NC3_8361N_4ND_3ND_D81DB8E3}
picoCTF{WH3R3_D035_7H3_F3NC3_8361N_4ND_3ND_D81DB8E3}