热线电话:13121318867

登录
2019-03-01 阅读量: 532
python如何提高录入密码的安全性

某些程序要求提出安全问题,而不是要求更改密码以提高安全性。在这里,提示可以更改为任何值。

# A simple Python program to demonstrate

# getpass.getpass() to read security question

import getpass

p = getpass.getpass(prompt='Your favorite flower? ')

if p.lower() == 'rose':

print('Welcome..!!!')

else:

print('The answer entered by you is incorrect..!!!')

输出 :

$ python3 getpass_example2.py

Your favorite flower?
Welcome..!!!

$ python3 getpass_example2.py

Your favorite flower?
The answer entered by you is incorrect..!!!
0.0000
1
关注作者
收藏
评论(0)

发表评论

暂无数据
推荐帖子