本文共 3131 字,大约阅读时间需要 10 分钟。
The Vernam cipher is a cipher technique that encrypts the plain text by working on the binary level of the text. Although not widely used due to its simplicity and being more prone to be cracked by any outsider, still this cipher holds much value as it is amongst the firstly developed encryption techniques (like the ).
Vernam密码是一种通过在文本的二进制级别上进行工作来对纯文本进行加密的密码技术。 尽管由于其简单性而未被广泛使用,并且更容易被任何外人破解,但该密码仍然具有很大的价值,因为它是最早开发的加密技术(如 )之一。
Now, talking about its characteristics and details, Vernam cipher is a cipher in which we consider both the plain text and the key string in its binary form.
现在,在谈论其特征和细节时, Vernam密码是一种密码,在该密码中,我们同时考虑纯文本和二进制形式的密钥字符串。
The following key points can be drawn for the Vernam cipher,
可以为Vernam密码得出以下要点,
The key chosen here is a string whose length must be either less or equal to the length of the plain text.
此处选择的键是一个字符串,其长度必须小于或等于纯文本的长度。
It is a type of .
它是一种 。
It is a type of poly-alphabetic cipher, being a part of the .
它是多字母密码的一种,是的一部分。
Here, firstly, we convert both our plain text and the key string into its binary form.
在这里,首先,我们将纯文本和密钥字符串都转换为二进制格式。
The key can be either in string form or directly in binary form also.
密钥可以是字符串形式,也可以是直接二进制形式。
The bits of the key string is repeated again and again until its length becomes equal to that of the plain text.
密钥串的位将被反复重复,直到其长度等于纯文本的长度为止。
Perform XOR operation between the elements of the plain text with the respective elements of the ley string which hold the same positions.
在纯文本的元素与ley字符串的各个元素保持相同位置之间执行XOR操作。
Therefore, the encryption on the plain text to convert it into ciphertext is performed as follows,
因此,对纯文本进行加密以将其转换为密文的过程如下:
E (Pi , Ki) = Pi (XOR) Ki
The process of decrypting the ciphertext to convert it back into plain text is performed in the same way as the encryption process. Therefore, the formula for decryption of the text under Vernam cipher is as follows,
解密密文以将其转换回纯文本的过程以与加密过程相同的方式执行。 因此,在Vernam密码下解密文本的公式如下:
D (Ci , Ki) = Ci (XOR) Ki
Given Plain text: 'IF' Key: 10100
Convert the given plain text into cipher text...
将给定的纯文本转换为密文...
Solution:
解:
Convert the given plain text into its binary form,
将给定的纯文本转换为其二进制形式,
1001001 1000110
Repeat the key sting until its length becomes equal to that of the plain text,
重复键击直到其长度等于纯文本的长度,
1 0 0 1 0 0 1 1 0 0 0 1 1 0 1 0 1 0 0 1 0 1 0 0 1 0 1 0
Tape the elements of the plain text with the respective elements of the ley string which hold the same positions.
将纯文本的元素与ley字符串的各个元素保持相同的位置。
Example for position 1, we encrypt as follows,
位置1的示例,我们加密如下,
E( 1, 1 ) = 1 XOR 1 = 0
Similarly, after performing the encryption for the whole plain text, we get the following results,
同样,在对整个纯文本进行加密之后,我们得到以下结果,
1 0 0 1 0 0 1 1 0 0 0 1 1 0 1 0 1 0 0 1 0 1 0 0 1 0 1 0 ----------------------------- 0 0 1 1 0 1 1 0 0 0 1 1 0 0
Note: You can cross-check your answer by applying the decryption process over the ciphertext, and if it comes back to be the same as the plain text, then it means that our answer is correct.
注意:您可以通过对密文应用解密过程来交叉检查您的答案,如果它与纯文本相同,则表明我们的答案是正确的。
翻译自:
转载地址:http://ghazd.baihongyu.com/