博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
md5不是对称密码算法_密码学中的消息摘要算法5(MD5)
阅读量:2531 次
发布时间:2019-05-11

本文共 4095 字,大约阅读时间需要 13 分钟。

md5不是对称密码算法

In cryptography, MD5 (Message-Digest algorithm 5) is a mainly used cryptographic hash function with a 128-bit hash value. As we use in an Internet standard (RFC 1321), MD5 has been employed or developed in a more variety of security applications and is also mainly used to check the integrity of files or the product. An MD5 hash is expressed as a 32 digit hexadecimal number in it.

在密码学中, MD5(消息摘要算法5)是主要使用的具有128位哈希值的密码哈希函数。 正如我们在Internet标准(RFC 1321)中使用的那样, MD5已在多种安全应用程序中使用或开发,并且还主要用于检查文件或产品的完整性。 MD5哈希表示为其中的32位十六进制数字。

MD5 is a strengthened or latest version of MD4. Similarly, like MD4, the MD5 hash was invented by "Professor Ronald Rivest" of MIT University. Also, MD5 was used as the model for SHA-1, since they sharing many common features between them. MD5 and SHA-1 are the two most mainly used hash algorithms nowadays, but the use of MD5 will certainly decline over time since it is now considered broken.

MD5是MD4的增强版本或最新版本。 类似地,像MD4一样,MD5哈希由麻省理工大学的“ Ronald Rivest教授”发明。 此外,由于MD5在SHA-1之间共享许多共同的功能,因此它们被用作SHA-1的模型。 MD5和SHA-1是当今两种最常用的哈希算法,但是MD5的使用肯定会随着时间的流逝而减少,因为现在认为它已被破坏。

算法 (The Algorithm)

The MD5 hash technique is described in "RFC 1321" along with a C implementation. MD5 is similar to the MD4 hash. The padding is identical.

MD5哈希技术与C实现一起在“ RFC 1321”中进行了描述。 MD5与MD4哈希类似。 填充是相同的。

MD5 works on 32-bit words. Let the required message to be implemented is "M".

MD5适用于32位字。 让所需的消息实现为“ M”。

The message "M" is padded so that its length in bits is similar to 448 modulo 512, that is, the padded message is less than 64 bits of multiple of 512.

填充消息“ M”,以便其长度(以位为单位)类似于448模512,即,填充的消息小于512的倍数的64位。

Firstly, the padding consists of a single 1 bit in the first column, followed by enough zeros to pad the message to the required length till the 512 bit. Padding is always used, even if the original length of M happens to equal 448 mod 512. As a result, there is at least one bit of padding, and at most 512 bits of padding. Then the length in bits of the message uses before padding is appended as a 64-bit block.

首先,填充由第一列中的单个1位组成,后跟足够的零以将消息填充至所需的长度,直到512位为止。 即使M的原始长度恰好等于448 mod 512,也始终使用填充。因此,至少有一位填充,最多512位填充。 然后,在填充之前将消息的长度(以位为单位)附加为64位块。

The padded message is a multiple of 512 bits and, it is also a multiple of 32 bits.

填充消息是512位的倍数,也是32位的倍数。

Let M be the required message and N is the number of 32-bit words used in the padded message. Due to the actual padding, N is a multiple of 16 bit.

令M为必填消息,N为填充消息中使用的32位字的数量。 由于实际的填充,N是16位的倍数。

MD5 (1)

There is a four-word buffer (A, B, C, D) is used to generate the message digest. Here each of A, B, C, D is a 32-bit buffer for a use. These buffer words are initialized to the following values in hexadecimal as follow,

有一个四字缓冲区(A,B,C,D)用于生成消息摘要。 在此,A,B,C,D中的每一个都是供使用的32位缓冲区。 这些缓冲字被初始化为以下十六进制值:

word A: 01 23 45 67    word B: 89 ab cd ef    word C: fe dc ba 98    word D: 76 54 32 10

We first define the four auxiliary functions which use in the buffer that each takes as input three 32-bit words and produces as output one 32-bit word.

我们首先定义在缓冲区中使用的四个辅助功能,每个辅助功能将三个32位字作为输入并产生一个32位字作为输出。

MD5 (2)

here

MD5 (c) it is logical "and",
MD5 (b) is logical "xor".

这里

MD5(a) 它是逻辑“或”,并且

The uses of the four buffers (A, B, C, and D) are now combined with the words of the input using the four auxiliary functions (F, G, H and I). Here, there are four rounds, each involves 16 basic operations to perform. One operation is shown in the figure below,

现在,使用四个辅助功能(F,G,H和I)将四个缓冲区(A,B,C和D)的使用与输入的单词组合在一起。 在这里,有四个回合,每个回合涉及要执行的16个基本操作。 下图显示了一种操作,

MD5 (3)

The figure shows how the auxiliary function "F" is used to the four buffers (A, B, C, and D), using the message word "M(i)" and constant "K(i)." The item "<<<n" denotes a binary left shift by n bits.

该图显示了如何通过消息字“ M(i)”和常量“ K(i)”将辅助功能“ F”用于四个缓冲区(A,B,C和D)。 项目“ <<< n”表示二进制左移n位。

The output

输出

After we perform all rounds, the buffers A, B, C, and D contain the MD5 digest of the original input.

完成所有回合后,缓冲区A,B,C和D包含原始输入的MD5摘要。

Mainly, MD5 has five steps with four rounds of computations that compute the hash of the input value and gave the buffer output.

MD5主要具有五个步骤,其中包括四轮计算,这些运算计算输入值的哈希值并给出缓冲区输出。

References:

参考文献:

翻译自:

md5不是对称密码算法

转载地址:http://uytzd.baihongyu.com/

你可能感兴趣的文章
20145303刘俊谦 Exp7 网络欺诈技术防范
查看>>
原生和jQuery的ajax用法
查看>>
iOS开发播放文本
查看>>
20145202马超《java》实验5
查看>>
JQuery 事件
查看>>
main(argc,argv[])
查看>>
源码:Java集合源码之:哈希表(二)
查看>>
【HDU 3709】 Balanced Number (数位DP)
查看>>
JsonPath的使用
查看>>
企业常用的站内收索、QQ群、在线客服
查看>>
Centos下安装nginx步骤解析
查看>>
EntityFramework Code First 添加唯一键
查看>>
在线教育工具—白板系统的迭代1——bug监控排查
查看>>
招行ODC项目表彰
查看>>
js补充知识点-label应用
查看>>
给构造函数(constructor)创建对象(object)
查看>>
局域网访问PHP项目网站 用IP地址进入
查看>>
VM虚拟机,Linux系统安装tools过程遇到 what is the location of the “ifconfig” program
查看>>
Jquery实现循环删除Reaper某一行
查看>>
脚本升级openssh
查看>>