I'd like to propose that Macaron switch from using MD5 to PBKDF2 for its AES keys
|
m := md5.Sum([]byte(secret)) |
I think using MD5 to generate AES keys has some serious flaws. For example, there's a good chance that someone could figure out the AES key in a few seconds if they have a good rainbow table. Also, you can generate MD5 hashes like crazy on consumer-level GPUs (1-5 billion hashes per second easy on a SINGLE GPU that's less than $500) so the key becomes very easy to attack. PBKDF2 is slow (key stretching) and specifically designed for this use case since it's a key derivation function.
Related to gogs/gogs#4117
I'd like to propose that Macaron switch from using MD5 to PBKDF2 for its AES keys
macaron/context.go
Line 443 in 78521e4
I think using MD5 to generate AES keys has some serious flaws. For example, there's a good chance that someone could figure out the AES key in a few seconds if they have a good rainbow table. Also, you can generate MD5 hashes like crazy on consumer-level GPUs (1-5 billion hashes per second easy on a SINGLE GPU that's less than $500) so the key becomes very easy to attack. PBKDF2 is slow (key stretching) and specifically designed for this use case since it's a key derivation function.
Related to gogs/gogs#4117