Security and Cryptography in Python - Key Exchange(1)

Security and Cryptography in Python - Key Exchange(1)

# 14 + 15 mode 12
val = (14 + 15) % 12
print(val)

# 4 * 5 mode 12
val = (4 * 5) % 12
print(val)

g = 2
for i in range(20):
    print(i, ((g**i) % 5))

Running Result:

image-20210214151644087

posted @ 2021-02-14 15:19  晨风_Eric  阅读(55)  评论(0编辑  收藏  举报