前言
做一些简单密码题,觉得记录一下密码,方便以后查找
圣堂武士密码(Templar Cipher)
标准银河字母
猪圈密码
仿射密码解密
def get(a
, b
):
if b
== 0:
return 1, 0
else:
k
= a
//b
remainder
= a
% b
x1
, y1
= get
(b
, remainder
)
x
, y
=y1
, x1
- k
* y1
return x
, y
s
= input("请输入解密字符:").upper
()
a
= int(input("请输入a:"))
b
= int(input("请输入b:"))
x
, y
= get
(a
, 26)
a1
= x
% 26
l
= len(s
)
for i
in range(l
):
cipher
= a1
* (ord(s
[i
])- 65 - b
) % 26
res
=chr(cipher
+ 65)
print(res
, end
='')
这个是看一文章的代码,我属于搬运工
当铺密码
田 口 0 由 1 中 2 人 3 工 4 土 士 5 天 王 6 夫 7 井 8 壮 9
天干地支+甲子
与ascll相关联
参考:https://blog.csdn.net/dyw_666666/article/details/89973048