希尔密码

Now, Hill Cipher is a very basic cryptographic technique which is used to convert a string into ciphertext. This technique was invented by an American Mathematician "Lester Sanders Hill". This is a polygraphic substitution cipher because the substitution or encryption is performed on the block on letters. It works on multiple letters at the same time. It was the first polygraphic cipher which was operable on more than 3 symbols.

现在, Hill Cipher是一种非常基本的加密技术,用于将字符串转换为密文。 这项技术是由美国数学家“莱斯特·桑德斯·希尔(Lester Sanders Hill)”发明的。 这是一个多图形替换密码,因为替换或加密是在字母上的块上执行的。 它可以同时处理多个字母。 这是第一个可用于3个以上符号的多重密码。

Implementation Technique

实施技术

加密 (Encryption )

In Hill Cipher, each letter is represented by a number modulo 26. So according to this, A = 0, B = 1, C = 2, ..., Z = 25. A string will be given to you and you have to make a column matrix using the letter-numberer relationship shown above. We'll be given a key matrix as well. We must ensure that | Key | should not be zero otherwise we can not apply hill cipher technique. This key matrix will be used in decryption as well. We need to multiply these two matrices. The formula for the ciphertext using Hill Cipher is:

Hill Cipher中 ,每个字母都由一个以26为模的数字表示。因此, A = 0,B = 1,C = 2,...,Z = 25 。 将为您提供一个字符串,您必须使用上面显示的字母-数字关系创建一个列矩阵。 我们还将获得一个密钥矩阵。 我们必须确保 关键 不应为零,否则我们将无法应用希尔密码技术 。 该密钥矩阵也将用于解密。 我们需要将这两个矩阵相乘。 使用希尔密码的密文公式为:

Here, n is the order of matrix or we can say the n is the number of letters we are taking at once to encrypt. Now, you'll get column matrix of order n x 1 which will have numbers from 0 to 25. You just have to replace the number with the letters from the relationship shown above and your ciphertext is ready.

在这里, n是矩阵的阶数,或者我们可以说n是我们一次要加密的字母数。 现在,您将获得顺序为nx 1的列矩阵,该列矩阵的数字从0到25。您只需要用上面显示的关系中的字母替换数字,即可准备好密文。

解密 (Decryption)

The letter-numberer relationship will remain the same in the decryption part. We'll use the inverse of the key matrix in decryption. Order of the matrix will remain the same. We need to multiply the inverse of the key matrix with the cipher text matrix we've got from the encryption technique. The formula is given below:

字母-数字关系在解密部分将保持不变。 我们将在解密中使用密钥矩阵的逆函数。 矩阵的顺序将保持不变。 我们需要将密钥矩阵的逆乘以从加密技术获得的密文矩阵。 公式如下:

Example:

例:

Let us take plain text: DOG and the key matrix is:

让我们采用纯文本:DOG和密钥矩阵为:

D = 3, O = 14 , G = 6 so our column matrix is:

D = 3,O = 14,G = 6,所以我们的列矩阵为:

Now we have to apply the multiplication as shown in the encryption formula. After multiplying and applying modulo 26 we got this cipher text matrix:

现在,我们必须应用加密公式中所示的乘法。 在乘并应用模26之后,我们得到了这个密文矩阵:

Now, 22 = W, 11 = L, 24 = Y

现在,22 = W,11 = L,24 = Y

So cipher text of DOG is WLY

所以DOG的密文是WLY

Now we'll do decryption and we'll use the generated ciphertext to convert it to plain text. First of all, we need to find the inverse of the key matrix. So the inverse of our key matrix is:

现在我们将进行解密,并将使用生成的密文将其转换为纯文本。 首先,我们需要找到密钥矩阵的逆矩阵。 因此,我们的密钥矩阵的逆是:

Now after multiplying the inverse matrix with the ciphertext matrix that we've generated in the encryption, we can get out plain text matrix again.

现在,将逆矩阵与我们在加密中生成的密文矩阵相乘后,我们可以再次得到纯文本矩阵。

So after multiplying and taking modulo 26, the decrypted matrix is:

因此,在乘以26后,解密后的矩阵为:

3 = D, 14 = 0 and 6 = G, So this is equal to the plain text it means our encryption and decryption both are right. Now, the Hill Cipher technique is over.

3 = D,14 = 0和6 = G,所以这等于纯文本,这意味着我们的加密和解密都是正确的。 现在, 希尔密码技术已经结束。

翻译自: https://www.includehelp.com/cyber-security/hill-cipher.aspx

希尔密码

希尔密码_希尔密码| 网络安全相关推荐

  1. java正则表达式验证密码_最新密码验证正则表达式

    正则表达式验证密码功能在项目中经常被使用到,但是很多朋友还是不大会使用密码正则表达式进行验证,本文小编为大家整理了php密码验证正则表达式.python密码强度正则,当然还有大家常用到的js正则表达式 ...

  2. vue 找回密码_找回密码的功能设计

    所有需要登录的网站,都会提供"找回密码"的功能,防止用户忘记密码. 正确设计这个功能,保证安全可靠,并不简单.下面就是安全专家 Troy Hunt 给出的设计指南. 一.如何保存密 ...

  3. linux中继器设置密码,无线扩展器管理员密码_初始密码是多少?-192路由网

    问:无线扩展器的管理员密码是什么? 我家里有一个无线扩展器,重新设置时,打开设置界面后,提示需要输入管理员密码. 我不记得这个管理员密码是多少了,请问扩展器的有初始管理员密码吗?有的话是多少呢? 答: ...

  4. 如何重新设置苹果id密码_路由器密码忘记了怎么重新设置 路由器密码忘了怎么办?详解路由器密码忘记解决办法...

    我们都知道如今的智能手机连wifi时都能自动记住密码,所以导致许多人没有记wifi密码,当手机更新,换手机后却无法连上wifi了,那么路由器WiFi密码忘记了怎么办?下面,小编就来跟大家讲解路由器密码 ...

  5. 编写python程序实现移位密码_移位密码

    密码学简介 这是我以前所不知道的. 密码学的基本目的是使两个在不安全信道中通信的人,通常称为Alice和Bob,以一种使他们的敌手Oscar不能明白和理解通信内容的方式进行通信. 定义:一个密码体系是 ...

  6. 电子邮件账号密码_电子邮件密码遭到破坏后如何​​恢复

    电子邮件账号密码 Your friends are reporting spam and pleas for money originating from your email account and ...

  7. mysql存储登录密码_当密码存储在选项文件中时,MySQL拒绝登录尝试

    第一: >我们正在运行MySQL 5.7.13. >操作系统是Red Hat Enterprise Linux 7.2. >首先使用Python / Connector 2.1.3发 ...

  8. java new url 带密码_获取密码重置URL

    我正在尝试修改默认的Laravel 5.6 Auth,以便通过电子邮件向新用户发送创建密码的链接,因为这是一个仅限邀请的系统,我不希望通过电子邮件将创建的用户的密码作为明文 . 在5.3中我能够做的是 ...

  9. 短语密码_使用密码短语以提高安全性

    短语密码 Did you know that Windows supports using passwords of up to 127 characters? I don't use passwor ...

  10. iphone怎么看wifi密码_无线网密码正确但是手机连接不上wifi怎么回事?

    现如今在家庭.咖啡厅和酒店等等,都在为手机提供免费的无线网络服务,但有时无线网络连接上了,却上不了网.那么,当无线网络连接上后手机无法连接网络是怎么回事呢?现在我们来谈谈. 1.IP地址冲突 有时,当 ...

最新文章

  1. phpMyAdmin 4.4.0 beta1 发布,MySQL 管理工具
  2. 基于Python的开源人脸识别库:离线识别率高达99.38%
  3. 攻防世界-web-bug-从0到1的解题历程writeup
  4. Shell按行读取文件的3种方法
  5. VS2010 + OpenCV 2.4.1 环境配置
  6. 线程切换是如何给 CPU 洗脑的?
  7. Matlab线性/非线性规划优化算法(4)
  8. JsonUtils工具类,拿来使用即可
  9. dnf韩服服务器维护中,DNF韩服官方居然自己在服务器上开了个“私服”深渊必掉史诗...
  10. ceph 纠删码解读和实践
  11. Qt-QtDesigner插件编写
  12. 3个免费的设计师图库,值得收藏
  13. mysql 经纬度范围_MySQL之根据经纬度查询多少公里范围内的数据
  14. 微信小程序微商城(五):动态API实现商品详情页(下)
  15. 戴尔服务器710u盘安装系统,联想G710笔记本U盘重装Win7系统教程
  16. [转]IE6下的CSS BUG枚举
  17. php绕过refer,绕过referer检测url跳转
  18. 数据采集-各工业设备-ModbusRtu说明
  19. MSP430时钟设置及应用总结
  20. Java实现贪吃蛇小游戏(附完整源码)

热门文章

  1. java实训致谢_Java教学实习报告(最终版).doc
  2. 最小生成树算法之Prim(普里姆)算法
  3. APP安全测试点概述
  4. 服务器文件传输抓包,Post入门篇 第12课multipart/form-data多部件上传抓包分析过程...
  5. python实现屏幕录制_python批量转换屏幕录像专家的exe视频
  6. kotlin使用gson解析json
  7. meshlab点云颜色偏暗
  8. JAVA小项目-银行管理系统(图形化界面)2-开户与挂失
  9. Brocade 光纤交换机保存配置
  10. Project(8)——收货地址——增加 --- 省市区数据处理