MD5

S

skibud2

I would like to use MD5 in my C program under linux. Can someone tell
me if there is a library that I can include?

Thanks,

Mike
 
F

Frederick Gotham

Kenny McCormack posted:

<snip drivel>


I have contacted Kenny's news provider to report abuse -- I would appreciate
if others would do so also.
 
K

Kenny McCormack

Kenny McCormack posted:

<snip drivel>


I have contacted Kenny's news provider to report abuse -- I would appreciate
if others would do so also.

I have contacted Frederick's news provider to report abuse -- I would
appreciate if others would do so also.
 
C

CBFalconer

Frederick said:
Kenny McCormack posted:

<snip drivel>

I have contacted Kenny's news provider to report abuse -- I would
appreciate if others would do so also.

Most of us can't do it. His posts never appear to us due to
PLONKing. They just trigger silly replies, which do come through,
and clutter the newsgroups.
 
K

Keith Thompson

Richard said:
He asked for Linux implementation.

Actually, he wrote "I would like to use MD5 in my C program under
linux." MD5 is a mathematical algorithm, not related to any
particular platform. I suppose you could write an MD5 implementation
that works only under Linux, but it probably would would be less than
ideal even under Linux, and could be improved considerably by dropping
the Linux-specific parts.
 
N

Nick Keighley

CBFalconer said:
Most of us can't do it. His posts never appear to us due to
PLONKing. They just trigger silly replies, which do come through,
and clutter the newsgroups.

he's usually ignored these days. If someone does respond they are asked

not to encourage him.
 
W

websnarf

Keith said:
Actually, he wrote "I would like to use MD5 in my C program under
linux." MD5 is a mathematical algorithm, not related to any
particular platform. I suppose you could write an MD5 implementation
that works only under Linux, but it probably would would be less than
ideal even under Linux, and could be improved considerably by dropping
the Linux-specific parts.

MD5 requires 32 bit rotation. So if an implementation relied on the
fact that gcc on Linux makes unsigned long exactly 32 bits, how could
it be "improved" by "dropping" this specific part? (To simulate a 32
bit rotation on a system that doesn't implement 32 bit longs, you would
have to perform an additional masking step.)
 
R

Richard

MD5 requires 32 bit rotation. So if an implementation relied on the
fact that gcc on Linux makes unsigned long exactly 32 bits, how could
it be "improved" by "dropping" this specific part? (To simulate a 32
bit rotation on a system that doesn't implement 32 bit longs, you would
have to perform an additional masking step.)

I'm a tad surprised at one or two of the comebacks on this thread. The
guy asks for an MD5 implementation on Linux, I point him to one and then
*bang* out come lectures in how the MD5 algorithm isn't Linux specific -
even though no one suggested it was.
 
K

Kenny McCormack

....
(someone else uttered)
(and rgrdev responded thusly)
I'm a tad surprised at one or two of the comebacks on this thread. The
guy asks for an MD5 implementation on Linux, I point him to one and then
*bang* out come lectures in how the MD5 algorithm isn't Linux specific -
even though no one suggested it was.

Sad, isn't it?

Welcome to clc!
 
R

Richard

...
(someone else uttered)

Sad, isn't it?

Welcome to clc!

It's all part & parcel of this group I guess. Although there does appear
to more jobsworths here now than a year ago : its almost a race to see
who can get the "Off Topic" rejoinder in first - and even then they
pretend not to see its already been done so that some poor newbie ends
up getting 6 or 7 chastising replies. All very sad IMO. If you cant help
or don't want to then don't post. Simple.
 
R

Richard Bos

MD5 requires 32 bit rotation. So if an implementation relied on the
fact that gcc on Linux makes unsigned long exactly 32 bits, how could
it be "improved" by "dropping" this specific part?

With a well-judged typedef, you could make the function rely only on
there being _a_ 32-bit unsigned integer, not on that type being unsigned
long specifically. With a bit of luck you'd get the bonus of still being
able to use your function after you install a 64-bit version of Linux.

Richard
 
C

CBFalconer

.... snip ...

MD5 requires 32 bit rotation. So if an implementation relied on
the fact that gcc on Linux makes unsigned long exactly 32 bits,
how could it be "improved" by "dropping" this specific part? (To
simulate a 32 bit rotation on a system that doesn't implement 32
bit longs, you would have to perform an additional masking step.)

Shift operations are not rotations. So you always have to do some
masking to implement them. Now you just have to think hard and
make that masking independant of the size of a long. And no
compliant implementation has longs of less than 32 bits.
 
K

Keith Thompson

MD5 requires 32 bit rotation. So if an implementation relied on the
fact that gcc on Linux makes unsigned long exactly 32 bits, how could
it be "improved" by "dropping" this specific part? (To simulate a 32
bit rotation on a system that doesn't implement 32 bit longs, you would
have to perform an additional masking step.)

% cat foo.c
#include <stdio.h>
#include <limits.h>
#include <stdlib.h>
int main(void)
{
printf("unsigned long is %d bits\n",
(int)(CHAR_BIT * sizeof(unsigned long)));
printf("uname is says: ");
fflush(stdout);
system("uname -s");
return 0;
}
% gcc foo.c -o foo
% ./foo
unsigned long is 64 bits
uname is says: Linux

You were saying?
 
K

Keith Thompson

Richard said:
(e-mail address removed) (Kenny McCormack) writes: [nothing worthwhile]
It's all part & parcel of this group I guess. Although there does appear
to more jobsworths here now than a year ago : its almost a race to see
who can get the "Off Topic" rejoinder in first - and even then they
pretend not to see its already been done so that some poor newbie ends
up getting 6 or 7 chastising replies. All very sad IMO. If you cant help
or don't want to then don't post. Simple.

Richard, *please* don't feed the troll. Argue about "off-topic"
rejoinders if you like, but please don't add to the noise level by
replying to Kenny McCormack. I think most readers here have killfiled
him long ago, for excellent reasons. He is not on your side.

The best way to deal with trolls is to ignore them. Completely.
We've been doing a pretty good job of ignoring KM; sadly, people have
started feeding him lately.

(I've seen KM post topical, and often correct, replies on other
newsgroups. I don't know, or care, why he chooses to be a troll
here.)
 
K

Kenny McCormack

Richard said:
(e-mail address removed) (Kenny McCormack) writes: [nothing worthwhile]
It's all part & parcel of this group I guess. Although there does appear
to more jobsworths here now than a year ago : its almost a race to see
who can get the "Off Topic" rejoinder in first - and even then they
pretend not to see its already been done so that some poor newbie ends
up getting 6 or 7 chastising replies. All very sad IMO. If you cant help
or don't want to then don't post. Simple.

Richard, *please* don't feed the troll. Argue about "off-topic"
rejoinders if you like, but please don't add to the noise level by
replying to Kenny McCormack. I think most readers here have killfiled
him long ago, for excellent reasons. He is not on your side.

Please don't feed the netcop.

Also, don't believe any of his nonsense of me being KF'd. I don't think
anyone has KF'd me (and if they have, then their killfiles need patching
with Elmer's Glue)
 
K

Keith Thompson

Keith Thompson said:
printf("uname is says: ");
fflush(stdout);
system("uname -s");
[snip]

Sorry, typo. That should have been "uname -s says: ", not
"uname is says: ".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,196
Latest member
ScottChare

Latest Threads

Top