How are MD5 hashes generated?
Hi i'm current playing with Linode Object store and one thing i noticed is the Etag format.
From my understanding this should be the MD5 hash of the file being uploaded. However they do not correspond to the MD5 hash generated by power shell.
powershell will generate something like: C526A75CF197B7F5DBFB01BA4395CCFF
linode will generate something like:
79EE6CA5AD2CFF0AEAA42FBF4A7A01B6-64
2 Replies
Apparently the "-64" represents the number of uploaded parts if Object Storage matches the AWS spec:
https://teppen.io/2018/06/23/aws_s3_etags/
For more info on the MD5 hashing algorithm, you can see here:
https://www.geeksforgeeks.org/what-is-the-md5-algorithm/
You probably don't have any control over this, but use of MD5 has been deprecated for many years because the algorithm was shown (and demonstrated) not to be collision-proof in 2004. If you can, you should switch to SHA-2 (SHA-1 suffers from the same affliction). See: https://en.wikipedia.org/wiki/MD5
That doesn't mean MD5 is not useful…it is. It's just not cryptographically secure.
-- sw