Advertisement
Xenithz

RailFence Encryption

May 15th, 2011
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. #### RailFence Encryption
  2.  
  3. word = "PythonisMagic"
  4. # P___o___M___c = PoMc   | read?  \    /\
  5. # _y_h_n_s_a_i_ = yhnsai |         \  /  \
  6. # __t___i___g__ = tig    |          \/    \
  7. # code: PoMcyhnsaitig <---
  8.  
  9. ###  Algo 1
  10.  
  11. code=array.array('c')
  12. for i in word[0::4]:code.append(i)
  13. for i in word[1::2]:code.append(i)
  14. for i in word[2::4]:code.append(i)
  15. print code
  16.  
  17. ### AND Algo 2
  18.  
  19. print word[::4]+word[1::2]+word[2::4]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement