Skip to contentSkip to conversation

Two Questions I Need Answered Please.

DISCUSSION Scott@Charter 2 participants 2 messages Mar 31, 2004

lore
Share & tools
lore
#0 lore raw

In the /etc/shadow file how is the password
"$1$shGNybY9$L)J1gwitzN6LoeS0pMpNc/" encrypted?

In the /etc/shadow file how is the password "!za1aId0hfZ2IA" encrypted and what significance does this password hold?

Thanks,
Scott
Reno, NV

BEGIN:VCARD
VERSION:2.1
N:Smallsreed;Scott
FN:Scott Smallsreed
TEL;HOME;VOICE:775-849-8411
TEL;HOME;FAX:775-849-8412
ADR;HOME:;;3030 Chipmunk Dr.;Washoe Valley;Nevada;89704;US LABEL;HOME;ENCODING=QUOTED-PRINTABLE:3030 Chipmunk Dr.=0D=0AWashoe Valley, Nevada 89704=0D=0AUS EMAIL;PREF;INTERNET:[email protected]
REV:20040331T034650Z
END:VCARD

#1 lore raw
Quoted 2 lines · Scott@Charter wrote:

In the /etc/shadow file how is the password
"$1$shGNybY9$L)J1gwitzN6LoeS0pMpNc/" encrypted?

Passwords aren't encrypted, but hashed. The distinction is that there isn't any way to decrypt the data in the shadow file to obtain the actual password. The password which is entered by the user is concatenated with the salt and the result is then hashed. The hash is compared against the one from the shadow (or passwd) file.

In the above, "$1$" indicates that the entry is hashed using MD5 (as opposed to the traditional DES hash), "shGNybY9" is the salt, and "L)J1gwitzN6LoeS0pMpNc/" is the base64-encoded hash (an MD5 hash is a 128-bit value).

Although, the glibc documentation (which concurs with my /etc/shadow file) says that the base64 encoding uses A-Z, a-z, 0-9 plus "/" (slash) and "." (period); no mention of ")".

Quoted 2 lines

In the /etc/shadow file how is the password "!za1aId0hfZ2IA" encrypted and what significance does this password hold?

That is a DES hashed password, where "za" is the salt and "1aId0hfZ2IA" is the base64-encoded DES hash (DES hashes are 64 bits, although only 56 bits are significant). The leading "!" indicates that the account is locked (it also ensures that any attempt to validate a password will fail, regardless of the actual password which is entered).

Signature · 1 line
Glynn Clements <[email protected]>