Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- encyption = [
- 'LpaGbbfctNiPvwdbjnPuqolhhtygWhEuafjlirfPxxl'
- ,'WdafvnbcDymxeeulWOtpoofnilwngLhblUfecvqAxs'
- ,'UijMltDjeumxUnbiKstvdrVhcoDasUlrvDypegublg'
- ,'LpaAlrhGmjikgjdmLlcsnnYmIsoPcglaGtKeQcemiu'
- ,'LpaDohqcOzVbglebjPdTnoTzbyRbuwGftflTliPiqp'
- ,'ATFW'
- ]
- def charConverter(inChar):
- inInt = ord(inChar)
- if inInt >= ord('a') and inInt <= ord('z'):
- return inInt - ord('a')
- elif inInt >= ord('A') and inInt <= ord('Z'):
- return inInt - ord('A')
- else:
- raise Exception("Invalid Char: "+inChar)
- def decoder(encyptChar,messageChar):
- encyptInt = charConverter(encyptChar)
- messageInt = charConverter(messageChar)
- keyInt = encyptInt - messageInt
- if keyInt < 0:
- keyInt = 26 + keyInt
- # print(decodedInt)
- return chr(keyInt + ord('A'))
- while True:
- inputValue = input("Enter the Encyption Key:")
- count = 0
- for encypted in encyption:
- output = "Input: "+str(count)+" Encoded Value:"+str(encypted)+" Message:"+inputValue+" key Value: "
- index = 0
- for messageChar in inputValue:
- output = output + decoder(encypted[index],messageChar)
- index = index + 1
- print(output)
- count = count + 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement