0

I am working on an environment that is in c# (not Genexus) and I need to encrypt data using the same implementatio of the TwoFish algorithm used by Genexus Encrypt64 method.

I have the encryption key and examples for some inputs (unencrypted) and the outputs (encrypted) that I should generate. I have prioblems because I got some implementations of the TwoFish algorithm from the web but none of them appear to be the same as thge one used in Genexus. Also, I tried some online tools and none of them worked.

Has anyone faced this problem before? Is there any other operation that I should be doing other than the TwoFish encryption? What mode does Genexus use for the TwoFish encryption?}

Thanks in advance!

gmesorio
  • 443
  • 2
  • 7
  • 17
  • You can import .dll in your project inside in directory of Gexenus (don't remenber the name), and use the functions for encrypt and decrypt. – Darlan Dieterich Aug 28 '18 at 16:56

1 Answers1

3

I found this info about twofish and GeneXus:

http://wiki.genexus.com/commwiki/servlet/wiki?8386,Encrypt64%20Function

And this is the algorithm: https://app.assembla.com/spaces/genexus_standard_classes/subversion/source/23/X_Ev2_U6/CSharp/GxClasses/Twofish_Algorithm.cs

If this do not help. Please elaborate your problem, for instance which input do you have and what is the expected output. And compare with the expected output. And of course what version of GeneXus you have to exchange data with.

PES
  • 168
  • 1
  • 5
  • 1
    Hi Paulo, thanks for your response. This seems to be a very useful code, as it appears to be the code used by Genexus. I have the input as string and the key as string. How should I make the call? The data I am using is: Input: 09/10/14 Key: dff60ebc093d5d12d90968cee4d55167 Output should be: jqcPVMd5ykivknralaM0LA== Thanks! – gmesorio Feb 17 '17 at 13:08
  • Also note that GeneXus looks for the encryption key on the `application.key` file, then in the assembly `KeyResolver.dll` and if not found (very common case) it uses the key `6A23DB2B6A619585C8B445D5949099E5`. You can take a look at the code in [Encryption.cs](https://app.assembla.com/spaces/genexus_standard_classes/subversion/source/23/X_Ev2_U6/CSharp/GxClasses/Encryption.cs) – Dinei Mar 24 '17 at 20:00