Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Key based Encryption/Decryption in ABAP

Former Member
0 Likes
2,957

Hi Experts,

I have a requirement where a string needs to be encrypted based on key/pwd and later needs to decrypted with the same key/pwd in ABAP.

Below is the highlights of requirement.

  1. Key/pwd has to be generated and stored for encryption/decryption.
  2. String needs to be encrypted with this key/pwd in ABAP.
  3. The encrypted string needs to be decrypted with the same key/pwd in ABAP.

Please suggest on how to achieve this in ABAP

Thanks,

Vijay

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,867

Hi,

Please check the class CL_HARD_WIRED_ENCRYPTOR.

Regards,

Taiyeb

5 REPLIES 5
Read only

Former Member
0 Likes
1,868

Hi,

Please check the class CL_HARD_WIRED_ENCRYPTOR.

Regards,

Taiyeb

Read only

0 Likes
1,867

Hi,

I checked the class 'CL_HARD_WIRED_ENCRYPTOR' but this does not align with my requirements since the string is not encrypted with any custom/generated  key/password.

Thanks,

Vijay

Read only

0 Likes
1,867

Hi,

I would suggest the following:

1. Generate the password using FM : RSEC_GENERATE_PASSWORD.

2. Create an FM ZENCRYPTxxxx passing the generated key/password and string .

3. In the ZENCRYPTxxxx FM call the method ENCRYPT_STRING2STRING (concat the key/pwd and string for the parameter) from the class cl_hard_wired_encryptor and get the encrypted string.

4. Store the key/password and encrypted string into your table.

5. Similarly create FM for decrypting and read from the table based on the password and use the decrypt_string2string from the cl_hard_wired_encryptor class.

Hope it helps.

Regards,

Taiyeb

Read only

sridhar_meesala
Active Contributor
0 Likes
1,867

This message was moderated.

Read only

Former Member
0 Likes
1,867

Hi Vijay,

Please check below SCN link for Encryption and Decryption. But I suggest it will be good if you can get catch of any UNIX consultant and get developed UNIX script of this.

          http://scn.sap.com/message/5753724#5753724