How to encrypt a string with des in pure C?

W

Walter Roberson

I mean to write the DES Algorithm myself.

I'm sure you can find plenty of DES encryption programs by
just googling for them.

Unless, that is, your government [China] is blocking those sites:
if so then it might not be the best of ideas for us to post the
algorithm.
 
O

osmium

lnzju said:
I mean to write the DES Algorithm myself.

PLEASE DON'T POST THIS GD HTML!

Why are you telling us this? There is no question there. You can write the
*code*, you can not write the algorithm. The algorithm is what *makes* the
thing DES.
 
J

Jordan Abel

PLEASE DON'T POST THIS GD HTML!

Why are you telling us this? There is no question there. You can
write the *code*, you can not write the algorithm. The algorithm is
what *makes* the thing DES.

Well, he could find a new and inventive way of getting the same results,
and then prove that it does yield the same results for all input.

[I suspect he'd be a bit out of his depth to attempt to do so, though]
 
L

lnzju

osmium said:
PLEASE DON'T POST THIS GD HTML!

Why are you telling us this? There is no question there. You can write the
*code*, you can not write the algorithm. The algorithm is what *makes* the
thing DES.
sorry,I just mean to encrypt a string with the exist algorithm in C
 
C

CBFalconer

osmium said:
PLEASE DON'T POST THIS GD HTML!

He didn't post in html. You are apparently using buggy Micro$loth
software.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Also see <http://www.safalra.com/special/googlegroupsreply/>
 
O

Obnoxious User

osmium skrev:
PLEASE DON'T POST THIS GD HTML!

Don't assume, make sure before you complain.
This is from the OPs header:

Content-Type: text/plain; charset="gb2312"

He's using simplified chinese charset, and if your newsreader can't
handle it the way you desire it to do, then trash it.
 
M

MrG{DRGN}

CBFalconer said:
He didn't post in html. You are apparently using buggy Micro$loth
software.

I'm using outhouse express and I didn't see it as html. Go figure.
 
O

osmium

:

I'm using outhouse express and I didn't see it as html. Go figure.

The thing that triggered my outburst was apparently character set gb2312
where gb does not stand for Great Britain. I really don't mind reading HTML
that much, my annoyance was that I can not easily break the chain and revert
to normal type. (Which is not to say there is not a way to do this.) But I
see in this case my response reverted to plain text; so it wasn't really
HTML, it just looked like HTML. I saw a largish sans serif font, as a rough
guess, it looked like Arial to me.

I suppose it is a revision level thing, this computer is about a year old
and I refuse to let those Redmond types do their automatic update thing.
 
J

Jordan Abel

:



The thing that triggered my outburst was apparently character set
gb2312 where gb does not stand for Great Britain. I really don't mind
reading HTML that much, my annoyance was that I can not easily break
the chain and revert to normal type. (Which is not to say there is not
a way to do this.) But I see in this case my response reverted to
plain text; so it wasn't really HTML, it just looked like HTML. I saw
a largish sans serif font, as a rough guess, it looked like Arial to
me.

Probably some chinese font. Many news readers will select a font
appropriate to the character set when available, even if no characters
are used that aren't representable by the default font. It also might
have selected a unicode font - Arial Unicode MS, perhaps, which ships
with office and covers the entire unicode set as of some revision.
I suppose it is a revision level thing, this computer is about a year
old and I refuse to let those Redmond types do their automatic update
thing.

Or you just misinterpreted what you saw. A sans serif font does not "it
looked like html" make.

If you couldn't tell if it was HTML or not, leave the complaints to
someone who can [since, after all, it doesn't affect you. if it _were_
html, it would affect me (since my newsreader doesn't handle html) since
i would be actually seeing html tags.]
 
S

Stephen Sprunk

osmium said:
PLEASE DON'T POST THIS GD HTML!

He didn't post in HTML. What makes his text look different in some
newsreaders (such as your OE) is that it was encoded in GB2312.

S

--
Stephen Sprunk "Stupid people surround themselves with smart
CCIE #3723 people. Smart people surround themselves with
K5SSS smart people who disagree with them." --Aaron Sorkin

*** Free account sponsored by SecureIX.com ***
*** Encrypt your Internet usage with a free VPN account from http://www.SecureIX.com ***
 
D

Dave Thompson

I'm sure you can find plenty of DES encryption programs by
just googling for them.
That's certainly true.
Unless, that is, your government [China] is blocking those sites:
if so then it might not be the best of ideas for us to post the
algorithm.

I don't see why -- most of us (including apparently you and certainly
me) live under governments that allow it. Even during the days of ITAR
the US officially only prohibited implementations, not algorithms. The
worst that could happen is that he wouldn't see it, which would leave
him no worse off than now.

There are certainly lots of places to find the algorithm as well, but
if you want an official one, it's at csrc.nist.gov, the Computer
Security Resource Center of the National Institute for Standards and
Technology of the Commerce Department, successor to the National
Bureau of Standards which originally published it. The slightly tricky
bit is that it's no longer officially a "FIPS" (Federal Information
Processing Standard); after being superseded by AES (the Advanced
Encryption Standard, FIPS 197, aka Rijndael) FIPS 46-3 was withdrawn,
but the document is still available, and the same _algorithm_ DEA is
still specified as part of TDEA (usually called triple-DES or 3DES) in
Special Publication 800-67.

In case the OP or anyone else doesn't know, I will point out that
(classic, single) DES/DEA is now in reach of brute force attack and
not secure again a serious adversary. If you actually want _security_,
not specifically DES, use something better. The simplest and usually
easiest is AES; if you don't want that, sci.crypt is a good place to
learn about other choices. (After you explain why not AES.)

- David.Thompson1 at worldnet.att.net
 
W

Walter Roberson

Unless, that is, your government [China] is blocking those sites:
if so then it might not be the best of ideas for us to post the
algorithm.
I don't see why -- most of us (including apparently you and certainly
me) live under governments that allow it. Even during the days of ITAR
the US officially only prohibited implementations, not algorithms. The
worst that could happen is that he wouldn't see it, which would leave
him no worse off than now.

Call me a coward if you will, but I don't need the Government of
China considering me to be An Enemy of the State. Particularily
not from my work account, considering that I work for the Government
of Canada.
 

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top