英文:
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).
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论