08:vigenère密码

1)Vigenére密码 (1) Vigenére Cipher)

This technique is an example of Polyalphabetic Substitution technique which uses 26 Caesar ciphers make up the mono-alphabetic substitution rules which follow a count shifting mechanism from 0 to 25. That is, for each plain-text character we have a corresponding substitution known as a key letter.

该技术是使用26个凯撒密码弥补随后的计数移动机构从0到25。也就是说,对于我们的相应取代已知为每个纯文本字符的单字母替换规则多码替代技术的一个例子关键信

To understand this technique we need to take a look on this Vigenére tableau.

要了解此技术,我们需要看一下Vigenére表格

The logic for this technique is simple, say for a key letter 't' and plain-text letter 'h', the corresponding cipher-text letter is at the intersection of row titled 't' and column titled 'h' thus for this case we get a ciphertext that would be 'A' based on above table.

这种技术的逻辑很简单,例如对于一个关键字母“ t”和纯文本字母“ h” ,相应的密文字母位于标题为“ t”的行与标题为“ h”的列的交点处。情况下,根据上表,我们将得到一个密文“ A”

It is clear that for encrypting a plain-text message we must need a key whose length is equal to the size of the plain-text message usually a repeating key is used.

显然,为了加密纯文本消息,我们需要一个长度等于纯文本消息大小的密钥,通常使用重复密钥。

2)Playfair密码 (2) Playfair Cipher)

Playfair cipher (aka Playfair square) is a cryptography technique used for manual encryption, it was introduced by Charles Wheatstone in 1854 but it was popularized by Lord Playfair hence his name used.

Playfair密码(又名Playfair平方)是一种用于手动加密的加密技术,由Charles Wheatstone于1854年提出,但后来被Playfair勋爵推广,因此使用了他的名字。

The Playfair cipher was used in world war I by the British army and in World war II it was used by Australians. It was because the Playfair cipher is quite fast to use and does not demand any special equipment.

Playfair密码在第一次世界大战中被英国军队使用,在第二次世界大战中被澳大利亚人使用。 这是因为Playfair密码使用起来非常快,并且不需要任何特殊设备。

Playfair technique has 2 major steps:

Playfair技术有两个主要步骤:

.minHeight{ min-height: 250px; } @media (min-width: 1025px){ .minHeight{ min-height: 90px; } } .minHeight{ min-height: 250px; } @media (min-width: 1025px){ .minHeight{ min-height: 90px; } }

Step 1: Creation and Population of matrix

步骤1:矩阵的创建和填充

This technique uses a 5 x 5 matrix which stores a keyword (or phrase) that becomes the key for encryption or decryption. This involves some set of fixed rule, those are:

该技术使用5 x 5矩阵 ,该矩阵存储一个关键字(或短语),该关键字成为加密或解密的密钥。 这涉及到一些固定规则,它们是:

  1. Fill the keyword in the matrix row-wise from left to right, top to down.

    从左到右,从上到下按行在矩阵中填充关键字。

  2. Remove all repeated letters.

    删除所有重复的字母。

  3. Enter the remaining spaces in the matrix with the rest of the English alphabets (A-Z) that were not a part of our keyword. In this process, combine I and J in the same cell of the table; in other words, if I and J is a part of the keyword disregard both I and J while filling the remaining slots.

    在矩阵中输入剩余的空格以及不属于我们关键字的其余英文字母( AZ )。 在此过程中,将IJ合并到表的同一单元格中; 换句话说,如果IJ是关键字的一部分,则在填充其余插槽时,请同时忽略IJ。

Example:

例:

Let's take our keyword as 'INCLUDEHELP IS AWESOME'. Then 5 x 5 matrix will look as:

让我们将关键字设为“ INCLUDEHELP IS AWESOME” 。 然后5 x 5矩阵将如下所示:

Step 2: Encryption

步骤2:加密

This process consist of the following process:

此过程包括以下过程:

  1. The plain-text we want to encrypt need to broke down into a pair of alphabets. For example, if our message is "MY NAME IS POGO", it will become "MY NA ME IS PO GO".

    我们要加密的纯文本需要分解为一对字母。 例如,如果我们的消息是“ MY NAME IS POGO” ,它将变成“ MY NA ME IS PO GO”

  2. If both alphabets are the same (or only left), add an X after the first alphabet in a pair. Encrypt the new pair (after adding X) then continue.

    如果两个字母相同(或仅向左),则在成对的第一个字母之后添加X。 加密新对(添加X之后 ),然后继续。

    1. If pair appears in the same row of the matrix, replace them with a letter at its right, if it's at the right end of the row then wrapping around the left side of the row.
  3. If pair appears in the same column of the matrix, replace them with the alphabet below them. If it's on the bottom then wrapping around the top of the row.

    如果对出现在矩阵的同一列中,请用其下面的字母替换它们。 如果它在底部,则环绕该行的顶部。

  4. If the pairis not in the same row or column, replace them with the alphabets in the same row respectively, but at the other pair of cornersof the rectangle defined by the original pair. The order is quite significant here. The first encrypt alphabet of the pair is the one that is present on the same row as the first plaintext alphabet.

    如果该对不在同一行或同一列中,则分别用同一行中的字母代替它们,而应替换为原始对定义的矩形的另一对角。 这里的顺序非常重要。 该对中的第一个加密字母是与第一个明文字母在同一行上的字母。

Explanation:

说明:

"MY NA ME IS PO GO"

“我不喜欢我”

So we start with MY now in the above matrix it was not in the same row or column then rule 5 will apply.

因此,我们从上面的矩阵中的MY开始,因为它不在同一行或同一列中,所以将应用规则5。

Now we replace 'MY' with the diagonals that are 'KZ'.

现在我们将对角线KZ替换为MY

Let's move to 'NA' again they are not in the same row or column, rule 5 will apply.

让我们再次移至“ NA”(它们不在同一行或同一列中),将应用规则5。

Now, 'NA' will be replaced with 'UE'.

现在, “ NA”将被替换为“ UE”

Similarly, "MY NA ME IS PO GO" will become "KZ UE FA LO DS BS".

类似地, “ MY NA ME IS PO GO”将变为“ KZ UE FA LO DS BS”

For the decryptionprocess, we will just follow the exact opposite steps.

对于解密过程,我们将遵循完全相反的步骤。

.minHeight{ min-height: 250px; } @media (min-width: 1025px){ .minHeight{ min-height: 90px; } } .minHeight{ min-height: 250px; } @media (min-width: 1025px){ .minHeight{ min-height: 90px; } }

3)希尔密码 (3) Hill Cipher)

The Hill cipher is based on polygraphic substitution that is it works on multiple letters at the same time, introduced by Lester Hill in 1929. This method related to the matrix theory of mathematics, specifically how to compute the inverse of a matrix.

希尔密码是基于多重图形替换的,它同时处理多个字母,这是莱斯特·希尔(Lester Hill)在1929年提出的。这种方法与数学的矩阵理论有关,特别是如何计算矩阵的逆。

Let's see how it works:

让我们看看它是如何工作的:

  1. Every Letter of plain-text will be represented by a number, so that A=0, B=1,...,Z=25.

    每个纯文本字母将由一个数字表示,因此A = 0,B = 1,...,Z = 25

  2. We will make a matrix of the plain-text message using the above knowledge.

    我们将使用以上知识来构成纯文本消息的矩阵。

    For example,

    例如,

    'CAT', so C=2, A=0, T=19. Thus our matrix lookslike:

    'CAT' ,因此C = 2,A = 0,T = 19 。 因此我们的矩阵看起来像:

  3. Now, we multiply our matrix with randomly chosen keys. The size of the key must be n x n where n is a number of rows of our plain-text matrix.

    现在,我们将矩阵与随机选择的键相乘。 键的大小必须为nxn ,其中n是纯文本矩阵的行数。

    For example:

    例如:

  4. Now multiply the above matrices,

    现在将上述矩阵相乘,

  5. Now we will calculate a mod 26 value of the above matrix, that is remainder after dividing 26.

    现在我们将计算上述矩阵的mod 26值,即除以26后的余数。

  6. Translate back number to alphabets, 5=F, 8=I, 13=N. Therefore, our cipher-text is "FIN".

    将数字转换回字母,即5 = F8 = I13 = N。 因此,我们的密文为“ FIN”

  7. For Decryption, take the cipher-text matrix and multiply it with the inverse of our original key matrix:

    对于解密,请采用密文矩阵并将其与原始密钥矩阵的逆矩阵相乘:

翻译自: https://www.includehelp.com/cryptography/cryptographic-techniques-vigenére-cipher-playfair-cipher-hill-cipher.aspx

08:vigenère密码

08:vigenère密码_密码技术:Vigenére密码,Playfair密码,Hill密码相关推荐

  1. 如何在linux系统下修改mysql密码_如何在linux下修改mysql数据库密码?linux修改数据库密码的方法...

    本篇文章给大家带来的内容是介绍如何在linux下修改mysql数据库密码?linux修改数据库密码的方法.有一定的参考价值,有需要的朋友可以参考一下,希望对你们有所帮助. Linux下修改Mysql的 ...

  2. 台式电脑如何设置开机密码_网络安全小黑板|如何设置开机密码

    2014 年 5 月 18 日,浙江湖州的吴女士发现支付宝上的 3 万多元不翼而飞,立即报警.后经湖州警方侦查,是因为两名 85 后嫌疑男子使用技术手段,远程操控了吴女士的计算机,在其中植入了木马病毒 ...

  3. mysql 8重置root密码_如何在MySQL 8中重置root密码

    MySQL中的用户密码存储在用户表中,密码重置实际上是改变该表中记录的值. 要在忘记密码的情况下更改密码,我们的想法是绕过MySQL的身份验证进入系统并使用SQL命令更新记录密码值. 在MySQL 5 ...

  4. chrome 保存密码_如何在Chrome中管理保存的密码

    chrome 保存密码 Google Chrome comes with a handy password manager already built in. You can have your br ...

  5. 怎么修改sqlserver用户密码_新版tplink路由器怎么修改管理员登录密码【修改方法】...

    tplink路由器的管理员密码,通常又叫做登录密码;进入设置页面的时候,必须要输入的一个密码. 重要说明: 本文介绍的修改管理员密码的方法,是建立在你知道原来的"管理员密码",目前 ...

  6. java设计帐号密码_怎样用java设置帐号和密码

    展开全部 public class User{ //定义私有属性  用户名和密码 private String userName; private String password; public Us ...

  7. mysql不显示默认密码_免安装版mysql不出现默认密码状况(基于mysql8.0)

    可以使用免密码安装命令 mysqld --initialize-insecure(建议使用这个命令) mysqld install net start mysql 然后启动了 进入mysql: mys ...

  8. mysql存储登录密码_用户身份验证:存储用户ID和密码在一个MySQL数据库

    //我们必须永远不会忘记启动会话 session_start(); $errorMessage = ''; if (isset($_POST['txtUserId']) && isse ...

  9. 如何重新设置苹果id密码_苹果怎么重新设置id账号和密码

    点击进入手机的[设置],然后点击[Apple ID选项],选择iForgot选项:您可以通过输入安全问题,或者获取验证邮件的方式,获得密码重设的链接,点击进入重设即可.以下是详细介绍: 1.打开苹果手 ...

  10. 如何给html文件夹密码,怎样给文件夹加上密码_分享两种给文件夹设密码的方法...

    现在大家习惯把重要的文件或比较隐私的文件存放在电脑上,出于安全考虑,大家会选择给文件夹设密码.但是问题来了,怎样给文件夹加密码呢?估计大多数的人都还不太清楚该怎么设置吧,别着急,这里小编分享两种给文件 ...

最新文章

  1. [转]WinForm下Splash(启动画面)制作
  2. 【杂谈】手把手带你配置深度学习环境
  3. split python
  4. python词云图代码示例 无jieba_【词云图】如何用python的第三方库jieba和wordcloud画词云图...
  5. django restframework 下载文件_【技术选型】Django还是Flask?这是个问题!
  6. apache camel_使用WildFly 8在Java EE7中自举Apache Camel
  7. unity3d 2D版本见缝插针demo
  8. C#LeetCode刷题之#867-转置矩阵(Transpose Matrix)
  9. Ubuntu执行脚本报错-bash: ./send.py: /usr/bin/python: bad interpreter: Permission denied
  10. 用python统计文章中单词出现的频次
  11. access html导出,AccessToFile
  12. Linux中hosts文件的修改
  13. 使用TraceView+实际案列实战性能分析 找出android app UI卡顿原因
  14. 取向性完全不同 骐达英朗底盘对比解析
  15. flea-cache使用之整合Memcached和Redis接入
  16. e.Row.RowType == DataControlRowType.DataRow诠释(实例解释)转自孤舟济海,云卷云舒
  17. 【C语言进阶】C语言程序设计:动态通讯录(顺序表实现)
  18. 微服务架构之服务调用
  19. WINDOWS下kill进程的命令
  20. Java WorkBook对Excel的基本操作

热门文章

  1. 【算法图解|1】js 实现一个函数,完成超过范围的两个大整数相加功能
  2. 一文精通CSS文本问题,你值得一看
  3. css3优惠卷上方锯齿_css3怎么实现锯齿边框?
  4. suse linux安装rpm包,linux – 如何为Suse创建RPM
  5. mysql增量_mysql实时增量备份
  6. vue给input file绑定函数获取当前上传的对象
  7. Event Loop 其实也就这点事
  8. 课时77.序选择器(掌握)
  9. Vue2.0 --- vue-cli脚手架中全局引入JQ
  10. Java属性中指定Json的属性名称(序列化和反序列化)