The openssl passwd command computes the hash of a password typed at run-time or the hash of each password in a list. The password list is taken from the named file for option -in file, from stdin for option -stdin, and from the command line otherwise. The UNIX standard algorithm crypt and the MD5-based BSD password algorithm 1 and its Apache variant apr1 are available.
I understand the term "hash" to mean "turn an input into an output from which is it difficult/impossible to derive the original input." More specifically, the input:output relationship after hashing is N:M, where M<=N (i.e. hash collision is possible).
Why is the output of "
openssl passwd" different run successively with the same input?
> openssl passwd Password: Verifying - Password: ZTGgaZkFnC6Pg > openssl passwd Password: Verifying - Password: wCfi4i2Bnj3FU > openssl passwd -1 "a" $1$OKgLCmVl$d02jECa4DXn/oXX0R.MoQ/ > openssl passwd -1 "a" $1$JhSBpnWc$oiu2qHyr5p.ir0NrseQes1
I must not understand the purpose of this function, because it looks like running the same hash algorithm on the same input produces multiple unique outputs. I guess I'm confused by this seeming N:M input:output relationship where M>N.