博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Vernam密码学
阅读量:2531 次
发布时间:2019-05-11

本文共 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 .

    它是多字母密码的一种,是的一部分。

加密过程 (Encryption Process)

  • 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

解密过程 (Decryption Process)

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

示例问题 (Example Problem)

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/

你可能感兴趣的文章
feign调用spring clound eureka 注册中心服务
查看>>
ZT:Linux上安装JDK,最准确
查看>>
LimeJS指南3
查看>>
关于C++ const成员的一些细节
查看>>
《代码大全》学习摘要(五)软件构建中的设计(下)
查看>>
C#检测驱动是否安装的问题
查看>>
web-4. 装饰页面的图像
查看>>
微信测试账户
查看>>
Android ListView上拉获取下一页
查看>>
算法练习题
查看>>
学习使用Django一 安装虚拟环境
查看>>
Hibernate视频学习笔记(8)Lazy策略
查看>>
CSS3 结构性伪类选择器(1)
查看>>
IOS 杂笔-14(被人遗忘的owner)
查看>>
自动测试用工具
查看>>
前端基础之BOM和DOM
查看>>
[T-ARA/筷子兄弟][Little Apple]
查看>>
编译Libgdiplus遇到的问题
查看>>
【NOIP 模拟赛】Evensgn 剪树枝 树形dp
查看>>
java学习笔记④MySql数据库--01/02 database table 数据的增删改
查看>>