Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def Rail_Fence_Encryption():
- Plain_Text = input("Please enter some plain text\n-->")
- while len(Plain_Text) % 12 != 0:
- Plain_Text += "X"
- Cipher_Text = []
- Index_Pattern = [[0,6],[1,5,7,11],[2,4,8,10],[3,9]]
- Index_Pattern_Original_Length = [2,4,4,2]
- for Iteration in range(1,round(len(Plain_Text)/12)):
- for Index, List in enumerate(Index_Pattern):
- for Entry in range(Index_Pattern_Original_Length[Index]):
- List.append(List[Entry]+(12*Iteration))
- for Line in Index_Pattern:
- for Index_Value in Line:
- Cipher_Text.append(Plain_Text[Index_Value])
- print("".join(Cipher_Text))
- """
- The following text:
- hello hello hello there there thereX
- Mapped like this:
- h/////h/////h/////t/////t/////t/////
- /e/// /e/// /e/// /h/// /h/// /h///X
- //l/o///l/o///l/o///e/e///e/e///e/e
- ///l/////l/////l/////r/////r/////r
- Produces this:
- hhhttte e e h h hXlololoeeeeeelllrrr
- """
- Rail_Fence_Encryption()
Advertisement
Add Comment
Please, Sign In to add comment