Skip to content

Switch from MD5 to PBKDF2 for AES keys #118

Description

@aaronjwood

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions