密码学
发布日期:2021-05-15 00:40:56 浏览次数:17 分类:精选文章

本文共 2741 字,大约阅读时间需要 9 分钟。

������������������

���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������A=0������������������������Z=25���������������������������3���������������A���������������D���B���������������E������������������

���������������������n������������������������������������������������

  • ���������������������x��������������������������������� (x + n) mod 26���
  • ���������������������x��������������������������������� (x - n) mod 26���

���Python���������������������������������������������������������������������

k = int(input('���������������:'))
lst = []
lst1 = []
def jiami():
str = input('������������������������������')
for i in str:
if 'a' <= i <= 'z':
i = chr((ord(i) + k - ord('a')) % 26 + ord('a'))
elif 'A' <= i <= 'Z':
i = chr((ord(i) + k - ord('A')) % 26 + ord('A'))
lst.append(i)
print('������������������������' + ''.join(lst))
def jiemi():
str = input('������������������������������')
for i in str:
if 'a' <= i <= 'z':
i = chr((ord(i) - k - ord('a')) % 26 + ord('a'))
elif 'A' <= i <= 'Z':
i = chr((ord(i) - k - ord('A')) % 26 + ord('A'))
lst1.append(i)
print('������������������������' + ''.join(lst1))
jiami()
jiemi()

������������������������������������������

������������������������������������������������������������������������

1. ������������

���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������AES������������������������������������������������������

2. ���������������

������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ Infrastructure���PKI������������������������������

3. ���������������

���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������

4. ������������������

������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������

5. ������������

���������������������������������������������������������������������������������������������������������������������������������������������������������������������������

上一篇:Java实现区块链
下一篇:Nodejs学习

发表评论

最新留言

初次前来,多多关照!
[***.217.46.12]2025年04月17日 23时03分39秒