Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import randint
- mykey = {
- "A":[1,2,3,4,5],
- "B":[11,12,13,14,15],
- "C":[21,22,23],
- "D":[31,32,33],
- "E":[41,42,43],
- "F":[51,52,53],
- "G":[61,62,63],
- "H":[71,72,73],
- "I":[81,82,83],
- "J":[91,92,93],
- "K":[101,102,103],
- "L":[111,112,113],
- "M":[121,122,123],
- "N":[131,132,133],
- "O":[141,142,143],
- "P":[151,152,153],
- "Q":[161,162,163],
- "R":[171,172,173],
- "S":[181,182,183],
- "T":[191,192,193],
- "U":[201,202,203],
- "V":[211,212,213],
- "W":[221,222,223],
- "X":[231,232,233],
- "Y":[241,242,243],
- "Z":[251,252,253]
- }
- word = raw_input("Input some Text : ").upper()
- cipher = [mykey[char][randint(0, len(mykey[char])-1)] for char in word]
- print "Cipher Text [%s] is = %s"%(word,cipher)
- """
- *****Debug Mode******
- $ python homo_poc.py
- Input some Text : homophonic
- H => 73
- O => 142
- M => 122
- O => 143
- P => 151
- H => 73
- O => 142
- N => 131
- I => 81
- C => 21
- Cipher Text is = [73, 142, 122, 143, 151, 73, 142, 131, 81, 21]
- """
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement