Encryption & Decryption of data using ABAP
Can we encrypt data with ABAP? I had been trying to find something out-of-box for a sometime. As usual I was searching SDN for some useful solutions, I found a code posted by Urgent Requirement: Encryption/Decryption in SAP in the forums and some pointer by Issuing cookies to the Class CL_HARD_WIRED_ENCRYPTOR. I just wanted to give a try to this one and to admit it was so easy to use. In this weblog I just take you through a simple example which uses all uses all the encryption and decryption methods of this class.
Declaration & Initial Part
Encryption – String to String
Decryption – String to String
Encryption – String to Byte
Decryption Byte to String
Encryption – Bytes to Bytes
Decryption – Bytes to Bytes
Adding to this there are methods for BASE64 encoding and decoding of binary data as well. Hope this is a very simple to use class for the encryption & decryption of data.
a very nice blog, but i cannot try it on my system. It's a WAS 6.20 abap system, and the cl_hard_wired_encryptor class is unknown.
regards,
Hans
I agree with Hans, it's a very useful blog. I wasn't aware of this class.
I couldn't find this class on our 6.20 system only on our 6.40 system.
Do you have an official info about this class availablilty? Is it possible to get it via SP to 6.20?
Thanks,
Peter
Thanks for your comments. Yes you are right this class is available only from 6.40. I got this information from Thomas's reply in the forum thread Issuing cookies
I could not find any offcial information for this class availability or getting it via SP to SP to 6.20 at Service Market Place.
I know this could be a disappointment, but there are some examples by Rich in the below thread Urgent Requirement: Encryption/Decryption in SAP This could work in your 6.20 system. Its worth a try.
Regards
Kathirvel
Thanks for the info. It would be nice if SAP would a downport for this. Even there is kernel dependencied, most of the BC 6.20 system running with 6.40 kernel.
However I don't think it will happen, as 6.20 is already an "old" release. 🙁
Peter
of this ???result_len(1) = the_byte_arrayoffs(1) bit-xor xor_val.i must be completely misunderstanding something...
You're right.
I didn't check what is inside of this class. Now I can see that there is no "magic" inside. So it's not a big deal to downport to a Z-class.
However now it's also clear based on the previous comment, that it wouldn't make too much sense as this class doesn't provide "real" encryption.
Peter
I guess that is available on 6.20 .
I wouldn't trust anything I expected to keep secure with this.
Hope this helps,
Nigel
I'd rather call this obscuration than encryption and it's definitely useful (if at all) internally only.
my 2 cents,
anton
Check the value of the 'string_in' :-)))
Peter
one more evidence that google translate sucks (as do all translators).
regards,
anton
Nice blog...Your doing a great job with encryptation or obfusting blogs -:)
Greetings,
Blag.
Since cryptographic software is subject to export control, you'll not find such a feature in ABAP.
Hi Kathirvel,
Well Explained.
My requirement is to hide my ABAP code in other systems. I want to assign a tcode to the program and don't want to give code readability of my source code.
It would be great if you can provide some inputs..!! 🙂
Thanks in advance. !!
Jabin
Hi Jabin,
I would not call ABAP to be "open source" but I'd state that it's intended that ABAP coding is always visible. By intend there's no mechanism to hide your ABAP coding.
If you want to ensure that someone can only use your service but will not gain access to the source code, then you might consider to provide a cloud service. Or (classic on-Premise) to provide an executable which acts as RFC server and which can be called from ABAP programs.
Regards, Wolfgang