开发者

Crypt type identification /etc/shadow

开发者 https://www.devze.com 2022-12-20 18:05 出处:网络
I know that the password field in /etc/shadow is prefixed with ${number}$ if it is not simply DES encrypted. What I am not able to find is a table that correlates the type of encryption to a given num

I know that the password field in /etc/shadow is prefixed with ${number}$ if it is not simply DES encrypted. What I am not able to find is a table that correlates the type of encryption to a given number.

For instance, $1$ would indicate MD5. Its the rest that escape me (i.e. SHA1, SHA256, Twofish, Blowfish, etc)

I've gone through the source to passwd and chpasswd as well as glib, but I'm not finding what I'm looking for.

Would someone mind sharing a link to a web page, or even a clue as to where In glib I might find such a table? I need to progmatically update passwords from within a program without using system() or exec*() calls. I'd like to write original code because开发者_Python百科 I want to keep a uniform 3 clause BSD license and full copyright over my code.

Forgive me if this is a duplicate. I found lots of questions regarding how to parse /etc/shadow, but none that specifically ask how to identify the encryption type of the second field.

Edit:

For reference, here is the announcement from the discussion group that moved forward implementing SHA (over DES) with support for BSD Blowfish.


The crypt(3) man page describes it in the NOTES section.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号