/etc/shadow. () . crypt (3). DES, glibc2 :
ID | Method
---------------------------------------------------------
1 | MD5
2a | Blowfish (not in mainline glibc; added in some
| Linux distributions)
5 | SHA-256 (since glibc 2.7)
6 | SHA-512 (since glibc 2.7)
, : $5$saltysalt$KhboodWTnuXJ5siXvWx5mxYXbnuNJOxROfD1inCILfD
$5 $ SHA-256, - , - .
, (3), , C:
#include <stdio.h>
#include <crypt.h>
int main(int argc, char *argv[]) {
printf("%s\n", crypt(argv[1], argv[2]));
}
cc mkpass.c -o mkpass -lcrypt, , /etc/shadow:
./mkpass yourpassword yoursalt
./mkpass yourpassword '$6$yoursalt$encrypted'
Linux-. ( $id $).