‎2019 May 23 11:48 AM
Hi, all.
I need to create a report to encrypt some fields in a table, and other report to read these data.
I've tried with FM FIEB_PASSWORD_ENCRYPT but is not working the FM FIEB_PASSWORD_DECRYPT.
With class CL_HARD_WIRED_ENCRYPTOR I can codify the data, but not encrypt it with a key.
In the end I'm using class CL_SEC_SXML_WRITER using an example I've seen in this link
But I'm having some problems.
-----
I've created a test report with the following selection screen:

You can use it to encrypt some amounts and its working fine:

But I need to save this encrypted data, read it and decrypt it. And this is where i'm having problems.
If you use the second option of the report to paste there an encrypted message (copied from the first option)
Its working fine with small amounts. (well i need to exit from the report and execute it again... dont know why)

But with "big" amounts, greater than 1000 is not working never. It's always throwing an exception.
------
I've attached the code of the test report.
Any help is welcome.
Thanks in advance.
Regards.
‎2019 May 23 1:52 PM
Hi, I tried your program, but could not replicate the exception.
Unencrypted message 999999999.00
Encrypted message: 0B67641708828405C2F5B74DB1E695BEFE59B14660D00C349A66242CBB845807
Tried both ways (radiobuttons) and no exceptions with PA_DES.
By the way our version of method cl_sec_sxml_writer=>decrypt is from 01.04.2016 19:39:25
‎2019 May 23 2:45 PM
Hi, Tomas.
Thanks for trying the program.
I've tried in two different enviroment and it's always triggering this exception.
Versión of methods decrypt from 2013 and 2016 each.
But the method only has one line:
method DECRYPT
by kernel module fxsec_writer_decrypt fail.
endmethod.A jobmate has also tried in other client and its also failing.
‎2019 May 23 2:55 PM
I have same content of method.
Try read exception text. you are only catching it, but not reading what exactly happened. Example:
CATCH cx_root INTO DATA(lo_root).
WRITE: / 'ERROR'.
data(l_dump1) = lo_root->get_text( ).
data(l_dump2) = lo_root->get_longtext( ).Maybe try look for sap notes about that decrypt/encrypt class, if there are some relevant for your system?‎2019 May 23 3:24 PM
Not too much information in the exception text:
"An exception with the type CX_SEC_SXML_ENCRYPT_ERROR was raised, but was not handled locally or declared in a RAISING clause."
Found some SAP notes; 2216901, 2292485.
I'm going to check them.
‎2019 May 23 4:24 PM
In the end I've managed to do it with other method, but with this one I need to maintain not only the key but also an Initialization vector.
I've attached the new test report.
I keep the question open in case someone knows how to solve the problem for the first program.