PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → [WD19] Share encrypted data between WinDev and C#
[WD19] Share encrypted data between WinDev and C#
Iniciado por guest, 14,nov. 2014 15:56 - 4 respuestas
Publicado el 14,noviembre 2014 - 15: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#?

Cheers,
Adri
Publicado el 14,noviembre 2014 - 16:11
Hey Adri,

Have you consulted the Help files?
http://doc.pcsoft.fr/en-US/?2512102&name=CryptMethod
<a class="ExternalLink" rel="nofollow" target="_blank" href="http://doc.pcsoft.fr/en-US/?3024014&name=Crypt">http://doc.pcsoft.fr/en-US/?3024014&name=Crypt</a>

You can force standard RC5 encrption in WD.

I presume C# can utilise RC5?

HTH
Publicado el 14,noviembre 2014 - 16:38
Hi Darren,

Thanks for your response. I did read the manuals <img src="/NG2013_WEB/ui/smiley/1.gif" align=absmiddle border=0 alt=":)">, 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,
Adri
Publicado el 14,noviembre 2014 - 17:46
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.

For instance; CryptRC5_16 in WD uses RC5 16 rounds on 128 bits (I believe).

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? <img src="/NG2013_WEB/ui/smiley/6.gif" align=absmiddle border=0 alt=";)">
Publicado el 14,noviembre 2014 - 18:26
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.

Cheers,
Adri