By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,583 Members | 1,126 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,583 IT Pros & Developers. It's quick & easy.

Rijndael in ASP.NET and Delphi

P: n/a
Who can help? I'm trying to implement an encrypted (plain text)
communication between a Delphi application and an ASP.NET. My choice
is AES/rijndael-128. For both sides, i use standard modules:

Delphi: TDCP_rijndael Component (DCPcrypt Cryptographic Component
Library v2) from cityinthesky (www.cityinthesky.com)

ASP.NET : Standard library of Rijndael

both sides are working, BUT they do different! The results in encryption
and decryption do not match when i use same keys. now i've no clue what
i am doing wrong.

Anyone out there who can give me the right hint??
Nov 28 '07 #1
Share this Question
Share on Google+
10 Replies


P: n/a
On Nov 29, 6:57 am, "Iwan Budihalim" <iwan_budiha...@visuallabs.net>
wrote:
Who can help? I'm trying to implement an encrypted (plain text)
communication between a Delphi application and an ASP.NET. My choice
is AES/rijndael-128. For both sides, i use standard modules:

Delphi: TDCP_rijndael Component (DCPcrypt Cryptographic Component
Library v2) from cityinthesky (www.cityinthesky.com)

ASP.NET : Standard library of Rijndael

both sides are working, BUT they do different! The results in encryption
and decryption do not match when i use same keys. now i've no clue what
i am doing wrong.

Anyone out there who can give me the right hint??
The first thing to do is find a third implementation - that way you
can easily find out which of your current implementations is broken.

Then it would help if you could post the C# code. It's easy to mess up
using encryption.

Jon
Nov 28 '07 #2

P: n/a
Hi Iwan,

I don't know the answer to your question, but have you considered doing the
Delphi side via a COM exposed C# dll. We have just starting doing this to
gain access to the .NET database libraries from Delphi and it is proving
very successful.

Cheers
Doug Forster

"Iwan Budihalim" <iw************@visuallabs.netwrote in message
news:eb**************@TK2MSFTNGP06.phx.gbl...
Who can help? I'm trying to implement an encrypted (plain text)
communication between a Delphi application and an ASP.NET. My choice
is AES/rijndael-128. For both sides, i use standard modules:

Delphi: TDCP_rijndael Component (DCPcrypt Cryptographic Component
Library v2) from cityinthesky (www.cityinthesky.com)

ASP.NET : Standard library of Rijndael

both sides are working, BUT they do different! The results in encryption
and decryption do not match when i use same keys. now i've no clue what
i am doing wrong.

Anyone out there who can give me the right hint??

Nov 28 '07 #3

P: n/a
On Wed, 28 Nov 2007 08:03:24 -0800 (PST), "Jon Skeet [C# MVP]"
<sk***@pobox.comwrote:
>The first thing to do is find a third implementation - that way you
can easily find out which of your current implementations is broken.
Try Bouncy Castle: http://www.bouncycastle.org/csharp/

I use their Java crypto library and it works very well.

rossum

Nov 28 '07 #4

P: n/a
Iwan Budihalim wrote:
Who can help? I'm trying to implement an encrypted (plain text)
communication between a Delphi application and an ASP.NET. My choice
is AES/rijndael-128. For both sides, i use standard modules:

Delphi: TDCP_rijndael Component (DCPcrypt Cryptographic Component
Library v2) from cityinthesky (www.cityinthesky.com)

ASP.NET : Standard library of Rijndael

both sides are working, BUT they do different! The results in encryption
and decryption do not match when i use same keys. now i've no clue what
i am doing wrong.

Anyone out there who can give me the right hint??
Same key size ? Same key ? Same iv ? Same sequences of update
and final calls ?

Arne
Nov 29 '07 #5

P: n/a
Iwan Budihalim wrote:
Who can help? I'm trying to implement an encrypted (plain text)
communication between a Delphi application and an ASP.NET. My choice
is AES/rijndael-128. For both sides, i use standard modules:

Delphi: TDCP_rijndael Component (DCPcrypt Cryptographic Component
Library v2) from cityinthesky (www.cityinthesky.com)

ASP.NET : Standard library of Rijndael

both sides are working, BUT they do different! The results in encryption
and decryption do not match when i use same keys. now i've no clue what
i am doing wrong.

Anyone out there who can give me the right hint??
If you post encryption of "This is a test" from both in hex or base64,
then we could compare.

Arne
Nov 29 '07 #6

P: n/a
I think, i better share the library so they can read between C# and Delphi.
"Doug Forster" <nobody@nowhere,comwrote in message
news:Oo**************@TK2MSFTNGP03.phx.gbl...
Hi Iwan,

I don't know the answer to your question, but have you considered doing
the Delphi side via a COM exposed C# dll. We have just starting doing this
to gain access to the .NET database libraries from Delphi and it is
proving very successful.

Cheers
Doug Forster

"Iwan Budihalim" <iw************@visuallabs.netwrote in message
news:eb**************@TK2MSFTNGP06.phx.gbl...
>Who can help? I'm trying to implement an encrypted (plain text)
communication between a Delphi application and an ASP.NET. My choice
is AES/rijndael-128. For both sides, i use standard modules:

Delphi: TDCP_rijndael Component (DCPcrypt Cryptographic Component
Library v2) from cityinthesky (www.cityinthesky.com)

ASP.NET : Standard library of Rijndael

both sides are working, BUT they do different! The results in encryption
and decryption do not match when i use same keys. now i've no clue what
i am doing wrong.

Anyone out there who can give me the right hint??


Nov 29 '07 #7

P: n/a
On Wed, 28 Nov 2007 22:57:26 -0800, "Iwan Budihalim"
<iw************@visuallabs.netwrote:
>Who can help? I'm trying to implement an encrypted (plain text)
communication between a Delphi application and an ASP.NET. My choice
is AES/rijndael-128. For both sides, i use standard modules:

Delphi: TDCP_rijndael Component (DCPcrypt Cryptographic Component
Library v2) from cityinthesky (www.cityinthesky.com)

ASP.NET : Standard library of Rijndael

both sides are working, BUT they do different! The results in encryption
and decryption do not match when i use same keys. now i've no clue what
i am doing wrong.

Anyone out there who can give me the right hint??
Just a thought, have you tried the official test vectors in FIPS 197:
http://www.csrc.nist.gov/publication...7/fips-197.pdf

You can play with both your implementations until you get the right
results from both of them.

For AES-128 (10 rounds) the official test vectors are:

PLAINTEXT: 00112233445566778899aabbccddeeff
KEY: 000102030405060708090a0b0c0d0e0f
CYPHERTEXT: 69c4e0d86a7b0430d8cdb78070b4c55a

rossum

Nov 29 '07 #8

P: n/a
Iwan Budihalim wrote:
I think, i better share the library so they can read between C# and Delphi.
AES is rather well define and it should be possible to find the problem.

And I would avoid using COM in ASP.NET if possible.

Arne
Dec 3 '07 #9

P: n/a
And I would avoid using COM in ASP.NET if possible.

Who said anything about using COM in ASP.NET ? I suggested he could use COM
to expose the .NET encryption libraries from his Delphi app. I still think
thats a good strategy as he would then be using the same libraries at each
end instead of messing about trying to find whatever quirky difference might
be causing his problem.

Cheers
Doug Forster
Dec 3 '07 #10

P: n/a
Doug Forster wrote:
>And I would avoid using COM in ASP.NET if possible.

Who said anything about using COM in ASP.NET ? I suggested he could use COM
to expose the .NET encryption libraries from his Delphi app.
Sorry - I have misread your post.

Arne
Dec 11 '07 #11

This discussion thread is closed

Replies have been disabled for this discussion.