md5 hash list készítése

Szeretném a users.txt file tartalmát beolvasni, minden egyes sorról md5 hash kivonatot készíteni.

Egyesével a parancs:
echo -n "password" | md5sum
5f4dcc3b5aa765d61d8327deb882cf99 -

Hogy lehet a legegyszerűbben megoldani parancssorból?
OS: Debian Linux

Köszönöm előre is a javaslatokat.

Hozzászólások

Kb.:

while read ; do md5sum <<<"$REPLY" ; done <users.txt

Mi benne a nem jó? Nálam:

$ rm md5_hashes
rm: cannot remove 'md5_hashes': No such file or directory
$ cat wordlist
alma
korte
szilva
$ for i in $(cat wordlist); do echo -n "$i"| md5sum | tr -d " -" >> md5_hashes; done
$ cat md5_hashes
ebbc3c26a34b609dc46f5c3378f96e08
597c6286705463db3f00bdfeed2a5296
6691b80d0404dfc1cc4bbc6a4c123bab
$

Üdv,
Marci

Nem hinném:

$ rm md5_hashes
rm: cannot remove 'md5_hashes': No such file or directory
$ cat wordlist2
alma
korte
szilva
$ file wordlist2
wordlist2: ASCII text, with CRLF line terminators
$ for i in $(cat wordlist2); do echo -n "$i"| md5sum | tr -d " -" >> md5_hashes; done
$ cat md5_hashes
d56d954f7c78a8414c52f43da9abd025
b5b050bf7b74c5615c64187a42d4e725
d98340f994c8d3b6f80c74e1edbe556c
$

Minden sorban 1 szó van? Nincs whitespace sehol?
Mi a tünemény, hogy nem működik?

Üdv,
Marci

Köszönöm a válaszokat. Megoldódott.
Igen, minden sorban egy szó van. A file-t kaptam.

Megoldás:
$ file wordlist2
wordlist2: ASCII text, with CRLF line terminators

El kellett távolítanom a CRLF line terminators, mert így a hash kimenet nem volt jó. Mást ad ASCII text-el és mást ASCII text, with CRLF line emulators-al.

sed -E 's/\r//g' wordlist2 >wordlist2_clean

Beraktam egy scriptbe.
Azt lehet valahogy automatizálni, hogy a kimeneti file név a bemenet-ből készüljön?
input: most_common
output: most_common_md5

#!/bin/bash
# Date: 2017.11.24
# Author: freeroute
# Purpose: create md5 hashlist dictionary
# Created: 2017.11.24.
# Modified: 2017.11.24
# Important! file formátumot ellenorizni. ASCII kell, CRLF line terminators has to be removed
# sed -E 's/\r//g' most_common.txt >most_common_clean.txt

DICTIONARY=most_common.txt

for i in $(cat $DICTIONARY)
do echo -n "$i"| md5sum | tr -d " -" >> most_common_md5.txt

done

#END