当前位置:   article > 正文

python实现经典密码学中Vigenere算法_vigenere密码python实现(1)_vigenère解密python

vigenère解密python
Program: Vigenère cipher (on alphabet string)

In this program, you are required to implement the Vigenère cipher algorithm from scratch, to encrypt and decrypt for alphabet string. The encrypt and decrypt method should be pure functions, i.e. without side effects.

Your program does the following:

  • Read an alphabet string from the console input, where the string is only consisting of 26 uppercase letters (A-Z). The first string represents the plaintext.
  • Read the second alphabet string. It is ensured that the length of second alphabet string is the same with the first string. The second string represents the key.
  • Encrypt the plaintext with the key.
  • Print the ciphertext alphabet string.
  • Decrypt the ciphertext with the key.
Example Input & Output

Input:

ABCDEFG
ABC
  • 1
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/640775
推荐阅读
相关标签
  

闽ICP备14008679号