[WD19] Share encrypted data between WinDev and C#

Startbeitrag von Adri am 14.11.2014 14:56

We have a WinDev and a C# application using the same database. Database settings are done in the WinDev application. We want to write the database setting encrypted in the registry (via WinDev) so the C# application can use the same database setting by reading and decrypting the info from the registry.

We are stuck in finding a way to decrypt data in C# which has been encrypted in WinDev. Does anybody have a clue if and what WinDev encryption settings can be used so it can be decrypted in C#?

Thanks for your response. I did read the manuals :), but maybe I missed something.

It seems like there is a difference in how RC5 is handled by WinDev and C#. The number of bytes doesn't match.

Cheers,
Adrivon Adri - am 14.11.2014 15:38

Hi Adri,

I'm not so sure it's simply a "difference" in how it's handled, because RC5 is a parameterised algorithm, e.g. RC5-w/r/b. So it depends how WD applies these parameters and also how your C# routine applies these parameters?

Sorry I can't give you a full solution to your problem, as I'm not a RC5 expert, but I've gleaned the following from the interweb in that RC5 parameters are as follows:w is the word size, in bits. The standard value is 32 bits; allowable values are 16, 32, and 64. RC5 encrypts two-word blocks: plaintext and ciphertext blocks are each 2w bits long.r is the number of rounds. Allowable values are 0, 1_255.
The number of bytes in the secret key K. Allowable values of b are 0, 1_255.

The unknown here is that the WD Help uses slightly different terminology and doesn't fully explain how it implements the different parameters, so it might call for a little bit of good-olde trial-and-error, albeit an educated bit of trial-and-error? ;)von DarrenF - am 14.11.2014 16:46

Hi Darren,

Thanks again. In the meantime we created a text file with all WinDev encryption options in it and try to find the match. I will post the results.