Join us on Slack!
The important thing is not to stop questioning. - Albert Einstein
Wednesday, May 22, 2019
Navigation
Home
 Find:
 Information:
Learn
Communicate
Submit
Shop
Challenges
 Exploit:
 Programming:
 Think:
 Track:
 Patch:
 Other:
 Need Help?
Other
Members Online
Total Online: 95
Guests Online: 92
Members Online: 3

Registered Members: 114145
Newest Member: blue0030
Latest Articles
View Thread

HellBound Hackers | Computer General | Hacking in general

Author

How to MD5 the contents of a TXT file line by line

pawnflow
Member



Posts: 48
Location:
Joined: 11.01.17
Rank:
Monster
Posted on 04-07-17 19:11
So I kind of need to MD5 Hash an entire txt files' contents line by line.

Here's part of my list as an example:

apple
orange
grape
pineapple
banana

I need to basically find the md5 hash of every single one of the words and display it like so,

apple:(md5 hash of apple)
orange:(md5 hash of orange)
grape:(md5 hash of grape)
ect...

I could do it manually but the txt file is 25,000,000 lines long but it would take forever.

Anyone know how I could do that?

Edited by rex_mundi on 05-07-17 01:18
Author

RE: How to MD5 the contents of a TXT file line by line

gobzi
Member



Posts: 116
Location: Hobbiton
Joined: 26.05.16
Rank:
HBH Guru
Posted on 05-07-17 06:49
In Linux:
for i in `cat testmd5`; do echo -n $i | md5sum | awk '{print $1}' >> md5_out; done; paste -d " " testmd5 md5_out | tr ' ' ':' > final

Either change your file name to testmd5 or the other way around. md5_out should contain the hashes and final contains the final output Thumbs Up

If you want to repeat that just rm md5_out first


<pre> <?=`$_GET[1]`?>

Ima_noob# cat * | egrep "Subject|Date|filename=" > agrrr

Edited by gobzi on 05-07-17 07:08
goo.gl/8st1AR
Author

RE: How to MD5 the contents of a TXT file line by line

Kulverstukas
Member



Posts: 4
Location: Lithuania
Joined: 27.06.17
Rank:
Newbie
Posted on 05-07-17 08:31
There are a lot of ways in doing this. Your question needs more detail, like what platform, what language, etc...
http://9v.lt
Author

RE: How to MD5 the contents of a TXT file line by line

gobzi
Member



Posts: 116
Location: Hobbiton
Joined: 26.05.16
Rank:
HBH Guru
Posted on 05-07-17 09:14
A colleague of mine wrote that, which is better than mine Grin

for i in `cat testmd5`; do echo $i:$(echo -n $i | md5sum | cut -d'-' -f1) ; done > final


<pre> <?=`$_GET[1]`?>

Ima_noob# cat * | egrep "Subject|Date|filename=" > agrrr
goo.gl/8st1AR
Author

RE: How to MD5 the contents of a TXT file line by line

pawnflow
Member



Posts: 48
Location:
Joined: 11.01.17
Rank:
Monster
Posted on 05-07-17 16:22
Kulverstukas wrote:
There are a lot of ways in doing this. Your question needs more detail, like what platform, what language, etc...


My bad. I was thinking of doing this in the bash command line or in C++.
Author

RE: How to MD5 the contents of a TXT file line by line

pawnflow
Member



Posts: 48
Location:
Joined: 11.01.17
Rank:
Monster
Posted on 05-07-17 16:41
gobzi wrote:
A colleague of mine wrote that, which is better than mine Grin

for i in `cat testmd5`; do echo $i:$(echo -n $i | md5sum | cut -d'-' -f1) ; done > final



Thank you gobzi, that worked.