lolamontes69

Python/ Simple ROT encryption

May 16th, 2013
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.49 KB | None | 0 0
  1. from string import maketrans   # Required to call maketrans function.
  2.  
  3. def rot_n()
  4.     print 'Using positive numbers only'
  5.     a = int(raw_input('Enter amount to ROT text by >\n'))
  6.  
  7.     intab = "abcdefghijklmnopqrstuvwxyz"
  8.     outtab = intab[a:]+intab[:a]
  9.     trantab = maketrans(intab, outtab)
  10.  
  11.     str1 = raw_input('Type in text to be ROTted >\n')
  12.     str2 = str1.lower()
  13.     print '\n------RESULT------\n'
  14.     print str2.translate(trantab);
  15.  
  16. rot_n()
  17.  
  18. """ Simple ROT encryption """
Advertisement
Add Comment
Please, Sign In to add comment