besser82 / libxcrypt

Extended crypt library for descrypt, md5crypt, bcrypt, and others
GNU Lesser General Public License v2.1
178 stars 49 forks source link

support SM3 hash algorithm #149

Closed myhou0418 closed 2 years ago

myhou0418 commented 2 years ago

Do we have plans to support the SM3 algorithm? Libgcrypt already supports SM3.

solardiz commented 2 years ago

I hope not! SM3 is a fast hash, not a password hash, and it would be a vulnerability to directly use it for passwords.

myhou0418 commented 2 years ago

Is SHA256 a vulnerability to directly use for passwords? The SM3 algorithm is an improved algorithm based on SHA-256. The compression function of the SM3 algorithm has a similar structure to the compression function of SHA-256, but the design of the SM3 algorithm is more complicated. For example, each round of the compression function uses 2 message words.

solardiz commented 2 years ago

Is SHA256 a vulnerability to directly use for passwords?

Yes, of course!