PHP MD5 实现
我目前正在尝试为大学项目的一部分编写一个代码 - 二进制/十六进制处理和加密函数在标记方案中得到了很好的重视,所以我想我会一石二鸟。
然而,关于算法本身的可用文档很详尽,但令人困惑。是否有一个预先存在的 PHP 库/类可供我查看,或者是否有对该算法及其使用的变量(尤其是 T 和 X)的逐步说明?
谢谢
I'm currently attempting to code one for part of a college project - binary/hex handling and cryptographic functions are well regarded in the mark scheme, so I thought I'd kill two birds with one stone.
However, the documentation availible on the algorithm itself is thorough but confusing. Is there a prexisting PHP libary/class that I could take a look at, or is there a step by step explanation of the algorithm, and the variables it uses (T and X especially) somewhere?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
获取 Bruce Schneier 的应用密码学的副本。尽管源代码是 C 语言,但他确实为算法背后的设计原理和理论提供了极好的背景。
Get hold of a copy of Bruce Schneier's Applied Cryptography. Although the source code is in C, he does provide an excellent background to the design principles and theory behind the algorithm.
维基百科对该算法有很好的描述(以及您应该避免使用它的正当理由) 。
它还包含其实现的完整伪代码示例。
Wikipedia has a good write up of the algorithm (along with the valid reasons you should avoid it).
It also contains a full pseudocode example of its implementation.
这是用 C 编写的 MD5。考虑到它不是 PHP,我不知道它是否有帮助,但它是:
http://www.google.com/codesearch/p?hl=en&sa=N&cd=10&ct=rc#zd_oLGoxqmg/md5.c&q=function% 20md5.c%20lang:c
Here's MD5 written in C. I don't know if it'll help, considering it's not PHP, but here it is:
http://www.google.com/codesearch/p?hl=en&sa=N&cd=10&ct=rc#zd_oLGoxqmg/md5.c&q=function%20md5.c%20lang:c