Absolute beginner here.
I have a list of passwords in a file named "pw.prn".
Welcome99
ABCDEFGH
12545678
lakers2021
gododgers
I wish to run each line in the file against a hashing program (mkpasswd -m sha-512)
and output the password concatenated with a semi-colon then results of the hashing process to a new file:
So the output would look like this:
Welcome99:$6$xDb6xNDzqtnwzVLz$LMA3CNodueIyZavW3CIGDdcl19cekNNG8EB5Hc/vMzZGUSRhbueNCkYRlyaGKAb/VjW0cBiCHdJLt4iL08gBn/
ABCDEFGH:$6$mANzCeK.SUgSD$ID/E6NYPp4cddHCevI.yua3HotbA/a7fZ7xjSk7dUI6fayuTMsO9SCdSA7MFcgh8SUcmNqrqqE4IxAoIEcmFb0
12345678:$6$CwjNF9B1Q8bkwohy$N4eZcj6YPxxbA1MYz0k9t96nCcj9VsZmzrvgqTd9tp2yXbzAdb3hWyjBq6nquMwFbKMJw9ZXs3Uqj.gfnozUS0
lakers2021:$6$fENvTJijoQgyjWMo$W37vZ364wQugW.W7k9Gl8OfJLl8DfR3tpFO/O4oPTCazJgNkJfNE4WiP4z8qSM8H1.ZJrMUWVAYdYOxt0GSHG1
gododgers:$6$1JdXTdpguO0$ZwFoDtZZ2byDemiLv5JAuea6ucAdtYQUTC4EppX2PMzSLaYtMm/ENpBZZAy70Ceuu6yAjXYtggrSOINTRWoBi0
Unfortunately, I have no "code that I have tried" as I do not even know where to being. Is this a for loop? While? I have tried searching using bash script with interactive answers from a file but have not been able to piece anything together.
I hope that my example provides enough information to understand what I am looking for.
I am running this on Ubuntu Linux
Thank You