Hi, this is my first post here and I'm very very new in 'C'
programming.
And I began to 'translate' my PHP program, that beyond a lot of things
generates a md5 hash, and I must generate a md5 hash in 'C' , but I
cant found it anywhere.
I've readed the crypt.h man page, I read twice the post in http://groups.google.com.br/group/co...4b37481e4d0b48
But I still dont know how to generate a md5 hash from my string
'testing' for example.
Plz, if anyone can help me I'd be glad
Thanks
Nov 15 '05
16 10715
"Mark" <so***@localbar .com> wrote in message
news:Vh******** ***********@new shog.newsread.c om... "dutche" <du****@gmail.c om> wrote in message news:11******** *************@g 49g2000cwa.goog legroups.com... Yes, I've readed the entire RFC, but as I said...I'm very new in 'C' and I copied the files that is in Appendix.
At this point, everything's fine...but when I try to compile it...like...I donno how to compile those files togheter.
I tried 'gcc mddriver.c -o mddriver' , and a lot of errors appears to me :/
I'm posting here cause I tried everything that I can with no results.
That's because the code provided with the RFC has a bug :-) At approximately line 20 or mddriver.c replace the following line:
#define MD MD5 with #define MD 5
That's should do the trick.
Regards, Mark
Worth mentioning: You'll also need to compile md5.c
$ gcc md5.c mddriver.c -o [whatever]
Mark
"dutche" <du****@gmail.c om> wrote in message
news:11******** **************@ g43g2000cwa.goo glegroups.com.. . First, I created these files:
global.h md5.h md5c.c mddriver.c
Ok, I made it exactly as described but when I try to compile I dont got any results, I think that I'm doing something wrong when compiling.
I've copied the source of the programs directly from the RFC site, and the command that I used is: 'gcc mddriver.c -o mddriver'
gcc md5.c mddriver.c -o mddriver
And the errors I got was...
caused by an bug in the code.
line 20 mddriver.c
#define MD MD5
should be
#define MD 5
dutche wrote: First, I created these files:
global.h md5.h md5c.c mddriver.c
Ok, I made it exactly as described but when I try to compile I dont got any results, I think that I'm doing something wrong when compiling.
I've copied the source of the programs directly from the RFC site, and the command that I used is: 'gcc mddriver.c -o mddriver'
And the errors I got was...
mddriver.c: In function `MDString': mddriver.c:106: error: `MD_CTX' undeclared (first use in this function) mddriver.c:106: error: (Each undeclared identifier is reported only once mddriver.c:106: error: for each function it appears in.) mddriver.c:106: error: parse error before "context" mddriver.c:110: error: `context' undeclared (first use in this function)
There are some errors in that source code at http://www.faqs.org/rfcs/rfc1321.html :
md5c.c line 82 (the blank line) should be deleted
mddriver.c line 21 should read:
#define MD 5
instead of
#define MD MD5
Note that md5c.c contains the functions for performing an MD5
operation (suitable for embedding in another project), and
mddriver.c is a commandline program that you can use to
call these functions.
If all you want to do is add these functions to another project
of yours, then you only need md5c.c .
Note that you have to tell GCC about all the source files you
want to compile:
gcc -o mddriver mddriver.c md5c.c
It's also a good idea to enable warnings:
gcc -o mddriver mddriver.c md5c.c -Wextra -Wall -ansi -pedantic
mddriver.c has a couple of warnings when compiled with these
switches, but they are ones you can safely ignore.
Finally, the source code in that RFC is a little archaic,
if you do a 'locate md5.c' on your system you will probably turn
up a lot of other implementations of it. For example, the PHP
source code contains it.
Is that point that I need to reach, I found that md5.c is the functions
to generate a hash right?
But (as I said I'm new in 'C') I cant realize which function is the
"hash maker".
Sorry, I'm still reading the K&R book but not too familiarized yet.
In article <11************ *********@g47g2 000cwa.googlegr oups.com>, ja**********@gm ail.com says... Please, learn how to ask an intelligent, useful question.
Please, learn how NOT to be a rude asswipe.
Red wrote: In article <11************ *********@g47g2 000cwa.googlegr oups.com>, ja**********@gm ail.com says...
Please, learn how to ask an intelligent, useful question.
Please, learn how NOT to be a rude asswipe.
While it is occasionally enjoyable to see a self-referential post, yours
is not at all amusing.
Martin Ambuhl wrote: Red wrote: ja**********@gm ail.com says...
Please, learn how to ask an intelligent, useful question.
Please, learn how NOT to be a rude asswipe.
While it is occasionally enjoyable to see a self-referential post, yours is not at all amusing.
No, but it does an admirable job of inciting PLONKs up and down the
seacoast.
--
Chuck F (cb********@yah oo.com) (cb********@wor ldnet.att.net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home .att.net> USE worldnet address! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: pembed2003 |
last post by:
Hi All,
Does C++/STL have hashtable where I can do stuff like:
Hashtable h<int>;
h.store("one",1);
h.store("two",2);
and then later retrieve them like:
|
by: Mamuninfo |
last post by:
Hello,
Have any function in the DB2 database that can generate unique id
for each string like oracle, mysql,sybase,sqlserver database.
In mysql:-
select md5(concat_ws("Row name")) from tablename;
Here this function generate unique id for each row of the table.
Regards..
|
by: Chang |
last post by:
How to get SHA1 or MD5 of a big file (+5MB - 20GB) as I can't read 20GB into
memory.
--
Chang.
|
by: mortb |
last post by:
Hi,
How do I write a GenerateHashcode function that will generate guaranteed
unique hashcodes for my classes?
cheers,
mortb
|
by: RossettoeCioccolato |
last post by:
Is there a brief tutorial somewhere on how to use the VC8 linker to generate
a manifest for an isolated application with a dependency section for an
arbitrary dll? There are some implementation details that I don't
understand. Supposing I want to bind my application to a specific version
of kernel32.dll using a hash, for example? What hash is used? Is it the
hash generated by the CryptCATAdmin* functions or just a simple hash of the...
| |
by: Johan Tibell |
last post by:
I would be grateful if someone had a minute or two to review my hash
table implementation. It's not yet commented but hopefully it's short
and idiomatic enough to be readable. Some of the code (i.e. the
get_hash function) is borrowed from various snippets I found on the
net. Thee free function could probably need some love. I have been
thinking about having a second linked list of all entries so that the
cost of freeing is in proportion to...
|
by: ravi |
last post by:
Hi
can anybody tell me that which ds will be best suited to implement a
hash table in C/C++
thanx. in advanced
|
by: jimhce |
last post by:
Hi,
I want to generate a hash key from a string, and I want to the hash key is the same value for the same string. But it turns out all the hash functions I have tried, generate different keys from the same string. For example, if I run an excusable hash function several times in following example, it gave me all different values even the string does not change:
$ BobJenkinHash "hello"
0x183B3443
$ BobJenkinHash "hello"
0x24082445
|
by: ChipAuger |
last post by:
Hello Group,
Thank you in advance to the group for all responses and help. I'm
looking for a 1-way hash for storing passwords on an older embedded
system that would be computationally stressed using SHA1. Does anyone
have any suggestions?
Thanks again,
Chip Auger
|
by: Ashish Khandelwal |
last post by:
As MSDN is not giving us guarantee upon uniqueness of Hash Code, so
could any one suggest me that how to generate a unique Hash Code for
same string always, and generate different-2 Hash Code Different-2
string.
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |