Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 191655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:21:36+00:00 2026-05-11T16:21:36+00:00

I am trying to do something in C with the MD5 (and latter trying

  • 0

I am trying to do something in C with the MD5 (and latter trying to do something with the SHA1 algorithm). My main problem is that I never really did anything complex in C, just simple stuff (nothing like pointers to pointers or structs).

I got the md5 algorithm here.

I included the files md5.c and md5.h in my C project (using codeblocks) but the only problem is that I don’t really understand how to use it. I have read and re-read the code and I don’t understand how I use those functions to turn ‘example’ into a MD5 hash.

I haven’t done C programming in a while (mostly php) so I am a bit lost here.
Basically what I am asking is for some examples of usage. They are provided via the md5main.c file but I don’t understand them.

Am I aiming high here? Should I stop all this and start reading the C book again or can anyone give me some pointers and see if I can figure this out.

Thanks.

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T16:21:36+00:00Added an answer on May 11, 2026 at 4:21 pm

    While I agree with Bill, you should go back to the C book if you want to really understand what you’re doing. But, in an effort to help, I’ve modified and commented some of the code from md5main.c…

    const char* testData = "12345";  // this is the data you want to hash
    md5_state_t state;  // this is a state object used by the MD5 lib to do "stuff"
                        // just treat it as a black box
    md5_byte_t digest[16];  // this is where the MD5 hash will go
    
    // initialize the state structure
    md5_init(&state);
    
    // add data to the hasher
    md5_append(&state, (const md5_byte_t *)testData, strlen(testData));
    
    // now compute the hash
    md5_finish(&state, digest);
    
    // digest will now contain a MD5 hash of the testData input
    

    Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

actually I thought I was trying something really simple. ControllerClassNameHandlerMapping sounded great to produce
I'm trying something really simple here, but can't figure out where I'm going wrong.
in the last 5 hours im trying to do something that should be very
Long time lurker of stackoverflow and just trying something with iframes and jquery which
I am new to the prototype framework and am trying something really simple and
Hello I'm trying something .. I was reading Jquery traversing documentations some forums, this
I'm trying something like this, but this example does not work. jsObj = {};
I'm trying something like this: [ServiceContract ( CallbackContract = typeof (CallbackContract_1), CallbackContract = typeof
I am trying something new and I am having issues with my current idea.
I'm trying something new and trying to run before I can crawl. I'm using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.