程序不打印解密结果

时间:2016-11-01 10:17:04

标签: python encryption

大家好我的python代码在输入最终输入后​​没有打印任何内容。你能帮我吗?非常感谢:)。

代码:

import getpass
import random                                                                                                                               #imports random module
import codecs                                                                                                                               #imports codecs module for encode task (UTF8)
import time

w = getpass.getpass("Input the Password: ") 
with open('Password.txt') as f:
    found = False
    for line in f:
        if w in line:

            Decrypted_Phrase = input("Please enter the phrase that you would like to decrypt: ")
            Number_Shift = input("Please enter the number the phrase was shifted by: ")

            Decryption_Base = ["abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890,./;:<>?'@#~]}[{=+-_)(*&^%$£!`¬\|"]
            Cipher = input("Please enter the keyword cipher to decrypt the phrase by: ")
            for c in Cipher:
                if c in Decryption_Base:
                    Actual_Cipher = Decryption_Base[(Decryption_Base.index(c)-Number_Shift)/(len(Decryption_Base))]
                    print (Actual_Cipher)

我已经为代码添加了时间,编解码器和随机数据。

编辑:

以下是代码输出的内容:

Warning (from warnings module):
  File "C:\Python34\lib\getpass.py", line 101
    return fallback_getpass(prompt, stream)
GetPassWarning: Can not control echo on the terminal.
Warning: Password input may be echoed.
Input the Password: Rah
Please enter the phrase that you would like to decrypt: n
Please enter the number the phrase was shifted by: ]YY
Please enter the keyword cipher to decrypt the phrase by: 44

0 个答案:

没有答案