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

Encrypt and Decrypt Data

Former Member
0 Likes
6,819

hi,

i'm looking for a way to encrypt or decrypt data before it's written or read from the database.

it should be possible to use some sort of key (or password) for the en- and decryption.

does somebody know some abap coding to take care that?

thanx in advance

12 REPLIES 12
Read only

Former Member
0 Likes
2,268

FIEB_PASSWORD_ENCRYPT and

FIEB_PASSWORD_DECRYPT are Function modules which does the same.

Read only

0 Likes
2,268

thanx for the quick response. i just don't know how to use this functionmodules. i think i interpret the parameters wrong.

REPORT EN_DECRYPT_TEST.

*

Data enpwd(32) type c.

parameter pwd like enpwd .

                • Encrypting *******************

CALL FUNCTION 'FIEB_PASSWORD_ENCRYPT'

EXPORTING

IM_DECRYPTED_PASSWORD = pwd

IMPORTING

EX_ENCRYPTED_PASSWORD = enpwd

.

                • Decrypting *******************

CALL FUNCTION 'FIEB_PASSWORD_DECRYPT'

EXPORTING

IM_ENCRYPTED_PASSWORD = enpwd

IMPORTING

EX_DECRYPTED_PASSWORD = pwd

.

                  • Output **********************

write:/ 'Encrypt data=', enpwd,

/ 'Decrypt data=', pwd.

Read only

0 Likes
2,267

Hi Dominik,

The usage of the Function module is correct but I am also lost as to how to explain the behavior of the decryption FM.

I'll explore some other Fms and get back to you.

Regards,

Ravi

Read only

0 Likes
2,267

Is someone there who knows a solution?

Read only

0 Likes
2,267

Dominik, your program actually works very good in my system.

Regards

Rich Heilman

Read only

0 Likes
2,267

Dominik,

In the FIEB_PASSWORD_ENCRYPT function module, if you double click on <b>perform encrypt_password</b>, there is a FORM called <b>character_search</b>. Look for a line like this:

<b>* describe field im_string length l_length.</b>

If this line is commented out, the encryption function module will not work. This line is commented out in my 4.7 system's FIEB_PASSWORD_ENCRYPT function module. I had to copy the code to my own function module and it works fine now.

Hope this helps,

Vince.

Read only

0 Likes
2,267

All,

We (still) have 4.6C system. These function modules work fine. I have couple of questions along this line though.

1) Do these FMs need SAPCrypto functionality for encryption and decryption? I don't beleive they do. If not, how does the FMs work?

2) Also, what type and level (RSA? 128-Bit) encryption do these modules use?

Appreciate your help.

-Thanks

Read only

0 Likes
2,267

Hi Vincent,

I have also copied FMs FIEB_PASSWORD_ENCRYPT and FIEB_PASSWORD_DECRYPT to uncomment piece of code you mentioned. But, I am not able to decypt the paswd properly. Help will be appriciated on how you have achieved this.

Gouri.

Read only

0 Likes
2,267

Maybe you can try this FM : DECODE_SLDPWD_BASE64 for 64 Bit encryption

Read only

0 Likes
2,267

Hi Indra,


Base64 is no encryption! This is a dangerous recomendation.

Best,

Jon

Read only

Former Member
0 Likes
2,267
Read only

dellagustin
Product and Topic Expert
Product and Topic Expert
0 Likes
2,267

Hi, check this article:

Best Regards,

Guilherme.