有没有Go版本的“基于MD5的分组密码”?

huangapple go评论106阅读模式
英文:

Is there a Go version of the "MD5-based block cipher"?

问题

我想实现一个Go应用程序,将一些私密数据发送到服务器。服务器上的代码是PHP,并使用了一个“基于MD5的分组密码”。PHP的加密/解密代码在这里:http://www.jonasjohn.de/snippets/php/md5-based-block-cipher.htm

在Go中有相应的例程吗?

英文:

I would like to implement a Go application that is going to send some private data to a server. The code on server is PHP and uses a "MD5-based block cipher". The PHP encrypt/decrypt code is here:
http://www.jonasjohn.de/snippets/php/md5-based-block-cipher.htm

Is there an equivalent routine in Go?

答案1

得分: 5

看起来这段代码类似于MDC算法,它是一种使用哈希函数生成密码的方法。

不过,有比这更好的密码算法 - 可以在Go的加密库中查看。

如果你非常想要与那段特定的PHP代码进行互操作,那么我认为你需要自己将其转换为Go代码,但如果我有选择的话,我会选择一个更好的密码算法(比如使用AES)。

英文:

It looks like that code is similar to the MDC algorithm which is a way of making a cipher from a hash function.

There are much better ciphers that that though - have a look in Go's crypto library.

If you are desperate to interoperate with that particular PHP code then you'll have to convert it to Go yourself I think, but if I had a choice I would choose a better cipher (something using AES).

huangapple
  • 本文由 发表于 2013年9月28日 17:45:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/19065549.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定