在/etc/shadow上使用哪种加密方法? [英] Which is the encryption method used on /etc/shadow?
本文介绍了在/etc/shadow上使用哪种加密方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在GNU/Linux系统上的/etc/shadow中使用哪种加密方法?我想编写一个用于个人目的的小程序,该程序使用相同的API,但目前我不知道从哪里开始.
Which is the encryption method used on /etc/shadow on GNU/Linux systems? I would like to write a small program for personal purpose that uses the same API, but at the moment I don't know where to start.
预先感谢
推荐答案
Use the crypt(3)
function. On glibc, the method used depends on the salt, if it starts with:
- $ 1 $:它使用MD5.
- $ 5 $:它使用SHA-256.
- $ 6 $:它使用SHA-512.
- $ 2a $:它使用河豚鱼,并非所有地方都支持.
- 否则,它使用DES.
这篇关于在/etc/shadow上使用哪种加密方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文