Md5sum is running very slowly

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Md5sum is running very slowly
# 15  
Old 01-29-2014
Nice alister - my perl skills are weak!

Can that beauty be enhanced to append the md5sum to the input file as a new field?
# 16  
Old 01-30-2014
Originally Posted by ahmedwaseem2000
Thanks for the code. I did try to compile but I get the error message as shown below. I have no c\c++ skills to be able to debug it. can you please help me?
As I said, you will probably need to install the openssh-dev library or whatever your distribution happens to call it. That's why md5.h is missing, because it's not installed.
# 17  
Old 01-30-2014
Do you mind sharing just the header file?
# 18  
Old 01-30-2014
I doubt you will get much out of the .h file without the library (.so files) on your system, as the .h file just defines the functions exported from the library.

Anything compiled will not link without the library.
# 19  
Old 01-30-2014
I agree, but I just wanted to give it a shot with the compilers I have Smilie
# 20  
Old 01-30-2014
Originally Posted by Chubler_XL
I doubt you will get much out of the .h file without the library (.so files) on your system, as the .h file just defines the functions exported from the library.
I would be astonished if Redhat didn't come with openssl...

But he doesn't need "a header file" -- he needs openssl's header files, a bunch of them, and the right ones for his version of openssl, correctly installed and configured in the correct places.

Last edited by Corona688; 01-30-2014 at 07:58 PM..
# 21  
Old 01-30-2014
OK well perhaps this may compile for him then:

#include <unistd.h>
#include <stdio.h>
#include <string.h>

typedef struct MD5state_st
 unsigned int A,B,C,D;
 unsigned int Nl,Nh;
 unsigned int data[(64/4)];
 unsigned int num;
 } MD5_CTX;
int MD5_Init(MD5_CTX *c);
int MD5_Update(MD5_CTX *c, const void *data, size_t len);
int MD5_Final(unsigned char *md, MD5_CTX *c);

int main()
        int n;
        MD5_CTX c;
        unsigned char buf[1024], out[16];
        while(fgets(buf, 1024, stdin))
                MD5_Update(&c, buf, strlen(buf)-1);
                MD5_Final(out, &c);
                for(n=0; n<16; n++)
                        printf("%02x", out[n]);

To link you will probably need -lssl -lcyrpto

Last edited by Chubler_XL; 01-30-2014 at 08:05 PM.. Reason: Removed some unnecessary stuff
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Checking Unix Performance - Why is a process running slowly?

Hi Please can someone explain to me how they would go about monitoring the performance of a process in Unix. Lets say that a user is running a process in Unix but it seems to be taking a long time, whereas it completed a lot quicker yesterday. How would you go about investigating what is causing... (1 Reply)
Discussion started by: Sunny Sid
1 Replies

2. SuSE

SLES 10 SP2 possible kernel problem, / slowly filling up

Hello Guys I first though about posting this to emergency but cause I fixed my issue with an reboot its not as important, more is important to me what caused this situation Some facts: OS: SLES 10 x64 SP2 (Virtualized Vmware ESX 3.5) / vmware tools status OK Soft: Oracle10g LVM... (1 Reply)
Discussion started by: kl1ngac1k
1 Replies

3. Solaris

Sun StorageTek Common Array Manager 6.0 works very slowly

Hi! I have Sun StorageTek 2540 FC array and CAM works very slowly - I can wait for software response even more than 2 minutes... I run this software on Windows machine with Firefox Web Browser but speed is terrible... How can I make it works at least a little bit faster?.. (2 Replies)
Discussion started by: Sapfeer
2 Replies

4. Shell Programming and Scripting

Running md5sum on a list of files

Hello, I would like to run md5sum on a list of files saved in a text file, and save the result in another file. (ie. md5sum `cat list.txt` > md5list.txt) I have tried several things, but I am always confronted to the same problem: some of the filenames have spaces. I have run sed on the... (5 Replies)
Discussion started by: SDelroen
5 Replies

5. Solaris

Delete and copy file(s) slowly(!?)

Hi all! I have to monitor space in V890 machine, Solaris 10 weekly, because there is Oracle DB on it with many datafiles which have been taken offline to make enough size. Sometime, one or more datafiles are big, they are 20GB, 40GB etc.. The problem I have encountered is the processing of... (5 Replies)
Discussion started by: trantuananh24hg
5 Replies

6. UNIX for Dummies Questions & Answers

What is md5sum???

Hi all, I am kinda puzzled. When and Why do we use md5sum? I've read man pages for mp5sum, but didn't get anything out of it. Please, can someone explain this to me in couple of words. Thank you all. (1 Reply)
Discussion started by: solvman
1 Replies
Login or Register to Ask a Question