猫史档案馆


【Python作品分享】加密/解密【作品秀】

用户:熊熊糖果熊熊糖果查看:0 回复:1 评论:0 创建时间:2020-03-14T08:48:43


【作品展示】

没有hhh

【作品介绍】

没有hhh

【作品源代码】


a_words = {'a': 'b', 'b': 'c', 'c': 'd', 'd': 'e', 'e': 'f', 'f': 'g', 'g': 'h', 'h': 'i', 'i': 'j', 'j': 'k', 'k': 'l', 'l': 'm',
           'm': 'n', 'n': 'o', 'o': 'p', 'p': 'q', 'q': 'r', 'r': 's', 's': 't', 't': 'u', 'u': 'v', 'v': 'w', 'w': 'x', 'x': 'y',
           'y': 'z', 'z': 'a', ' ': ':', ',': ';', '.': '`', '!': '^', '?': '$', "'": '*'}
b_words = {'b': 'a', 'c': 'b', 'd': 'c', 'e': 'd', 'f': 'e', 'g': 'f', 'h': 'g', 'i': 'h', 'j': 'i', 'k': 'j', 'l': 'k', 'm': 'l',
           'n': 'm', 'o': 'n', 'p': 'o', 'q': 'p', 'r': 'q', 's': 'r', 't': 's', 'u': 't', 'v': 'u', 'w': 'v', 'x': 'w', 'y': 'x',
           'z': 'y', 'a': 'z', ':': ' ', ';': ',', '`': '.', '^': '!', '$': '?', '*': "'"}

_s = ''
if input('请选择功能(加密输入1:解密输入0)')=='1':
    s =input('请输入要加密的内容(全英文)')
    for i in s:
        _s = _s+a_words[i]
    print('加密完成\n%s' % _s)
else:
    s = input('请输入要解密的内容(全密文)')
    for i in s:
        _s = _s+b_words[i]
    print('解密完成\n%s' % _s)

 

【提示】

部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:

https://python.codemao.cn


回复

上一页1 页 / 共 1下一页
EUWEUW

看一下我的 https://shequ.codemao.cn/community/1626931

点赞0


评论