forked from thewhitetulip/SamplePythonScripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmono.py
More file actions
29 lines (27 loc) · 846 Bytes
/
mono.py
File metadata and controls
29 lines (27 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
'''
#!/usr/bin/python
#Author: Suraj Patil
#Version: 2.0
#Date: 27th March 2014
implements the monoalphabetic algorithm
every alphabet in a..z is replaced by a unique character
'''
import string
#import random
letters = string.ascii_letters
small=[]
cap=[]
mapping={}
for i in range(0,51):
if i<26:
small.append(letters[i])
else:
cap.append(letters[i])
#for i in range(0,25):
# mapping[small[i]] = chr(random.randint(33,96))
mapping = {'a': '.', 'c': 'I', 'b': '4', 'e': 'T', 'd': ')', 'g': 'V', 'f': 'W', 'i': ':',
'h': 'U', 'k': 'Q', 'j': ',', 'm': '[', 'l': 'R', 'o': '$', 'n': 'T', 'q': '<', 'p': 'L',
's': 'P', 'r': '@', 'u': '0', 't': 'I', 'w': '*', 'v': 'Y', 'y': '6', 'x': ':'}
cleartext = raw_input('enter cleartext:')
for i in range(0,len(cleartext)):
print mapping[cleartext[i]],