473,320 Members | 1,829 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Rijndael in ASP.NET and Delphi

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
10 7766
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
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
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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ignacio De Marco | last post by:
I'm not very familiar with C, so I would like to ask you how can use the algorithm Rijndael, suppousing that I want two simple functions (in C ANSI) implementing the CBC or ECB Modes (is the same...
3
by: Amy L. | last post by:
I have a client / server application. I just want to encrypt small amounts of data 1<x<1024 characters or so. I need to load the same Key and IV in both applications. However, both the key and...
5
by: William Stacey [MVP] | last post by:
The Decypt2() method below does not work. It completes, but does not do the right thing. The first transform request returns 0 bytes. The first Decypt() method works as we work on a stream...
4
by: Mantorok | last post by:
Hi I have a couple of encryption methods but when I call decrypt I get the string back but with a load \0 escape characters on the end? Any idea why? It is actually causing problems in some...
5
by: ~~~ .NET Ed ~~~ | last post by:
Anybody has any idea why this simple thing is not working? I pass a text file as input to encrypt it, then pass the encrypted version to the same function and get some garbled data not at all...
0
by: Jens Müller | last post by:
Hello, I try to program a Rijndael encryption in Windows which has to be compatible with php. In php I use the code below to encrypt with a 256 Bit Key and a 256 Bit block cipher. My windows...
1
by: RJ | last post by:
The 2.0 Framework SDK only has examples where the Rijndael class instance provides the key. I've tried setting my own key value, making sure my key length matches the KeySize property of my...
4
by: Sylvie | last post by:
http://www.obviex.com/samples/Encryption.aspx According to this link, I am using Rijndael Encryption & Decryption Algorithms, But I want my encrypted strings just CAPS string and just...
3
by: KBS Developer | last post by:
Hi, I can encrypt without any problem but while decrypting I got junk. I've read the other thread about getting junk but that is not my case. Here is the sample code: private Rijndael...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.