JuliaCrypto/SHA.jl

Add MD5

oxinabox opened this issue ยท 8 comments

@staticfloat

What do you think of the notion of adding a pure julia MD5 to this package?
Conceptually it seems pretty similar to SHA1, so there is maybe some code overlap?
(But I am not crypto guy. I know they are both from the same linage of hash functions.)

We have access to MD5 in Nettle.jl, MbedTLS.jl and Crypto.jl but all three wrap binaries.
Which doesn't seem worth it for such a simple short algorithm.

I want it for DataDeps.jl, because most public data sources provide MD5 sums (if they provide a checksum at all).
For example: http://datadryad.org/resource/doi:10.5061/dryad.ds68r/4

I've started to implement it, but I'm not sure how much of the code for SHA I can reuse.

I think it's probably not worth it to try and integrate it into SHA.jl; perhaps eventually we will have a Crypto.jl that has a nice family of Julia-native hash functions, but I would say you should instead just write it in your own MD5.jl, get it working nice and fast, and then we can look at merging the two together sometime in the future if it makes sense. It's possible the update!() and digest!() common functions from SHA.jl are the same conceptual operations you would perform on MD5 hashes, but I'm honestly not sure.

Ok, I'll make a MD5.jl, and i'll import SHA: update!, digest! if required.

Also feel free to just copy-paste so that you're not adding more dependencies (Although SHA.jl is probably second only to Compat.jl in terms of number of installs in the Julia ecosystem..... which is kind of crazy)

I think if I don't I'll have namespace related issues.
Any time they are both used in the same package

Any updates on this? As it so happens I have a usecase for DataDeps where the website only provides md5 checksums. Its not a real problem to compute my own sha hashes, but using something the main authors provide would be nice

No, I got busy.
I am pretty sure with a little fiddling one can wrap Nettle.jl, or MedTls.jl's MD5 functions to use with DataDeps.
But I would rather have a pure julia (and pure MIT licensed) solution

Right, I don't think a heavy dependency is worth it. For now I just checked manually that the md5 checksums matched the website, and then computed sha hashes myself

https://github.com/oxinabox/MD5.jl

It needs #49 to be merged before it will work