您的位置:首页 > 编程语言 > Python开发

使用python实现简单的序列密码

2014-11-21 22:39 405 查看
使用python 实现简单的序列密码

#!/usrs/bin/env python
print '\nStream Ciphers:\n'
before = 'One apple a day, keeps the doctor away!'
after = ""
i = 1
for each in before:
after += chr(ord(each)^(63+i))
if i == 4:
i = 1
print 'before: ',before,'\n'
print 'after: ',after,'\n'
revert = ""
i = 1
for each in after:
revert += chr(ord(each)^(63+i))
if i == 4:
i = 1
print 'revert: ',revert,'\n'
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: