<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Problem encrypting data in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-encrypting-data/m-p/11894072#M1961775</link>
    <description>&lt;P&gt;Hi, all.&lt;/P&gt;
  &lt;P&gt;I need to create a report to encrypt some fields in a table, and other report to read these data.&lt;/P&gt;
  &lt;P&gt;I've tried with FM FIEB_PASSWORD_ENCRYPT but is not working the FM FIEB_PASSWORD_DECRYPT.&lt;/P&gt;
  &lt;P&gt;With class CL_HARD_WIRED_ENCRYPTOR I can codify the data, but not encrypt it with a key.&lt;/P&gt;
  &lt;P&gt;In the end I'm using class CL_SEC_SXML_WRITER using an example I've seen in &lt;A href="https://stackoverflow.com/questions/49981557/how-to-use-encryption-in-sap"&gt;this link&lt;/A&gt;&lt;/P&gt;
  &lt;P&gt;But I'm having some problems.&lt;/P&gt;
  &lt;P&gt;-----&lt;/P&gt;
  &lt;P&gt;I've created a test report with the following selection screen:&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1688486-1.jpg" /&gt;&lt;/P&gt;
  &lt;P&gt;You can use it to encrypt some amounts and its working fine:&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1688481-2.jpg" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;BR /&gt;But I need to save this encrypted data, read it and decrypt it. And this is where i'm having problems.&lt;/P&gt;
  &lt;P&gt;If you use the second option of the report to paste there an encrypted message (copied from the first option) &lt;BR /&gt;Its working fine with small amounts. (well i need to exit from the report and execute it again... dont know why)&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1688488-3.jpg" /&gt;&lt;/P&gt;
  &lt;P&gt;But with "big" amounts, greater than 1000 is not working never. It's always throwing an exception.&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1688483-4.jpg" /&gt;&lt;A href="https://answers.sap.com/storage/temp/1688484-test-report.txt"&gt;test-report.txt&lt;/A&gt;&lt;/P&gt;
  &lt;P&gt;------&lt;/P&gt;
  &lt;P&gt;I've attached the code of the test report.&lt;BR /&gt;&lt;BR /&gt;Any help is welcome.&lt;/P&gt;
  &lt;P&gt;Thanks in advance.&lt;BR /&gt;Regards.&lt;/P&gt;</description>
    <pubDate>Thu, 23 May 2019 10:48:14 GMT</pubDate>
    <dc:creator>RicardoRomero_1</dc:creator>
    <dc:date>2019-05-23T10:48:14Z</dc:date>
    <item>
      <title>Problem encrypting data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-encrypting-data/m-p/11894072#M1961775</link>
      <description>&lt;P&gt;Hi, all.&lt;/P&gt;
  &lt;P&gt;I need to create a report to encrypt some fields in a table, and other report to read these data.&lt;/P&gt;
  &lt;P&gt;I've tried with FM FIEB_PASSWORD_ENCRYPT but is not working the FM FIEB_PASSWORD_DECRYPT.&lt;/P&gt;
  &lt;P&gt;With class CL_HARD_WIRED_ENCRYPTOR I can codify the data, but not encrypt it with a key.&lt;/P&gt;
  &lt;P&gt;In the end I'm using class CL_SEC_SXML_WRITER using an example I've seen in &lt;A href="https://stackoverflow.com/questions/49981557/how-to-use-encryption-in-sap"&gt;this link&lt;/A&gt;&lt;/P&gt;
  &lt;P&gt;But I'm having some problems.&lt;/P&gt;
  &lt;P&gt;-----&lt;/P&gt;
  &lt;P&gt;I've created a test report with the following selection screen:&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1688486-1.jpg" /&gt;&lt;/P&gt;
  &lt;P&gt;You can use it to encrypt some amounts and its working fine:&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1688481-2.jpg" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;BR /&gt;But I need to save this encrypted data, read it and decrypt it. And this is where i'm having problems.&lt;/P&gt;
  &lt;P&gt;If you use the second option of the report to paste there an encrypted message (copied from the first option) &lt;BR /&gt;Its working fine with small amounts. (well i need to exit from the report and execute it again... dont know why)&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1688488-3.jpg" /&gt;&lt;/P&gt;
  &lt;P&gt;But with "big" amounts, greater than 1000 is not working never. It's always throwing an exception.&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1688483-4.jpg" /&gt;&lt;A href="https://answers.sap.com/storage/temp/1688484-test-report.txt"&gt;test-report.txt&lt;/A&gt;&lt;/P&gt;
  &lt;P&gt;------&lt;/P&gt;
  &lt;P&gt;I've attached the code of the test report.&lt;BR /&gt;&lt;BR /&gt;Any help is welcome.&lt;/P&gt;
  &lt;P&gt;Thanks in advance.&lt;BR /&gt;Regards.&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2019 10:48:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-encrypting-data/m-p/11894072#M1961775</guid>
      <dc:creator>RicardoRomero_1</dc:creator>
      <dc:date>2019-05-23T10:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: Problem encrypting data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-encrypting-data/m-p/11894073#M1961776</link>
      <description>&lt;P&gt;Hi, I tried your program, but could not replicate the exception.&lt;/P&gt;&lt;P&gt;Unencrypted message   999999999.00&lt;/P&gt;&lt;P&gt;Encrypted message:   0B67641708828405C2F5B74DB1E695BEFE59B14660D00C349A66242CBB845807&lt;BR /&gt;Tried both ways (radiobuttons) and no exceptions with PA_DES.&lt;BR /&gt;By the way our version of method cl_sec_sxml_writer=&amp;gt;decrypt is from 01.04.2016 19:39:25&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2019 12:52:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-encrypting-data/m-p/11894073#M1961776</guid>
      <dc:creator>Tomas_Buryanek</dc:creator>
      <dc:date>2019-05-23T12:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: Problem encrypting data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-encrypting-data/m-p/11894074#M1961777</link>
      <description>&lt;P&gt;Hi, Tomas.&lt;BR /&gt;Thanks for trying the program.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I've tried in two different enviroment and it's always triggering this exception.&lt;/P&gt;&lt;P&gt;Versión of methods decrypt from 2013 and 2016 each.&lt;/P&gt;&lt;P&gt;But the method only has one line:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;method DECRYPT
  by kernel module fxsec_writer_decrypt fail.
endmethod.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;A jobmate has also tried in other client and its also failing.&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2019 13:45:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-encrypting-data/m-p/11894074#M1961777</guid>
      <dc:creator>RicardoRomero_1</dc:creator>
      <dc:date>2019-05-23T13:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: Problem encrypting data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-encrypting-data/m-p/11894075#M1961778</link>
      <description>&lt;P&gt;I have same content of method.&lt;BR /&gt;Try read exception text. you are only catching it, but not reading what exactly happened. Example:&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CATCH cx_root INTO DATA(lo_root).
      WRITE: / 'ERROR'.
      data(l_dump1) = lo_root-&amp;gt;get_text( ).
      data(l_dump2) = lo_root-&amp;gt;get_longtext( ).&lt;/CODE&gt;&lt;/PRE&gt;Maybe try look for sap notes about that decrypt/encrypt class, if there are some relevant for your system?&lt;BR /&gt;BTW: do not answer to people here with "Answer" to your own original question. There are comments for commenting &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Thu, 23 May 2019 13:55:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-encrypting-data/m-p/11894075#M1961778</guid>
      <dc:creator>Tomas_Buryanek</dc:creator>
      <dc:date>2019-05-23T13:55:19Z</dc:date>
    </item>
    <item>
      <title>Re: Problem encrypting data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-encrypting-data/m-p/11894076#M1961779</link>
      <description>&lt;P&gt;Not too much information in the exception text:&lt;/P&gt;&lt;P&gt;"An exception with the type CX_SEC_SXML_ENCRYPT_ERROR was raised, but was not handled locally or declared in a RAISING clause."&lt;BR /&gt;&lt;BR /&gt;Found some SAP notes; 2216901, 2292485.  &lt;BR /&gt;I'm going to check them.&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2019 14:24:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-encrypting-data/m-p/11894076#M1961779</guid>
      <dc:creator>RicardoRomero_1</dc:creator>
      <dc:date>2019-05-23T14:24:35Z</dc:date>
    </item>
    <item>
      <title>Re: Problem encrypting data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-encrypting-data/m-p/11894077#M1961780</link>
      <description>&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;I've attached the new test report.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I keep the question open in case someone knows how to solve the problem for the first program.&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2019 15:24:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-encrypting-data/m-p/11894077#M1961780</guid>
      <dc:creator>RicardoRomero_1</dc:creator>
      <dc:date>2019-05-23T15:24:03Z</dc:date>
    </item>
  </channel>
</rss>

