Skip to content

Latest commit

 

History

History

rail-fence

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Challenge: rail-fence

Category: Cryptography

Point Value: 100

Author: WILL HONG


Description:

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}.

Write-Up:

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}

FLAG:

picoCTF{WH3R3_D035_7H3_F3NC3_8361N_4ND_3ND_D81DB8E3}

Footnotes

  1. Included links to the source code may be out of date as they were what I recorded during the competition, and may be different now. 2