Não & não às suas perguntas.
Eu daria uma olhada na função crypt(3) para mais informações. De man crypt(3) :
GNU EXTENSION
The glibc2 version of this function has the following additional features. If salt is a character string starting with the three characters
$1$followed by at most eight characters, and optionally terminated by$, then instead of using the DES machine, the glibc crypt function uses an MD5-based algorithm, and outputs up to 34 bytes, namely$1$&‹string›$, where‹string›stands for the up to 8 characters following$1$in the salt, followed by 22 bytes chosen from the set[a–zA–Z0–9./]. The entire key is significant here (instead of only the first 8 bytes).
Você pode verificar sua configuração de pam para ver se está usando MD5 ou DES:
$ egrep "password.*pam_unix.so" /etc/pam.d/system-auth
password sufficient pam_unix.so md5 shadow nis nullok try_first_pass use_authtok
E você pode ver neste arquivo /etc/shadow dos sistemas que está usando o MD5 também:
root:$1$<DELETED PASSWORD HASH>:14245:0:99999:7:::
Os códigos que você verá no /etc/shadow para cada tipo de hashing:
- $ 1 - MD5
- $ 2 - blowfish
- $ 2a - eksblowfish
- $ 5 - SHA-256
- US $ 6 - SHA-512
Nas distros da Red Hat você pode mudar isso usando o comando authconfig .
$ sudo authconfig --passalgo=sha512 --update