Vigenère cipher
出题人太菜,暂无测试数据。
Topic Background
The Virginia cipher (also known as the
The Virginia cipher has been invented several times. The method was first documented in the book The Cipher of Mr. Giovan Battista Bellaso
(Italian: Virginia Code
.
The Vigenère cipher is known for its simplicity and ease of use, as well as being difficult for beginners to decipher, and is therefore also known as the unbreakable cipher
(French:
Title Description
The Virginia cipher is a key
Modern Virginia cipher substitution table is as follows, the first row of the key, the first column of plaintext, a plaintext corresponding to the key encryption of the resulting ciphertext that is the letter of the row at the column.
Input and output formats
Input format
First line an integer
The next
Line
Line
Line
Output format
A total of
Sample
Input
Output
Sample Explanations
plaintext:
key:
First letter plaintext
, key , encrypted against the Virginia cipher table the ciphertext is .Sixth letter plaintext
, key does not exist, so reset key , encrypted against Virginia cipher table ciphertext is .The fifteenth letter plaintext
, the key , and the ciphertext encrypted against the Virginia cipher table is .Therefore, the final encrypted ciphertext is
.ciphertext:
.Ciphertext:
.First letter ciphertext
, key , decrypted against the Virginia cipher table the plaintext is .Sixth letter cipher
, key does not exist, so reset key , decrypted against the Virginia cipher table the plaintext is .The fifteenth-letter ciphertext
, the key , and the plaintext decrypted against the Virginia cipher table is .Therefore, the final decrypted plaintext is
.
Data range
Tip
Virginia cipher table
If you need a Chinese translation, click here.