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

Need help on Encryption and decryption

Former Member
0 Likes
2,241

Hi Experts,

Im in the need of encrpt and decrpt some text. For that I used Function modules,

SSFC_BASE64_DECODE

SSFC_BASE64_ENCODE

First I decode the text using SSFC_BASE64_DECODE.

Input : ABCD123

Output : 001083D76D

I passed this output to SSFC_BASE64_ENCODE

Input : 001083D76D

But the output this FM is ABCD120=.

Why its not giving the proper output?

Can any one help me on this?

Thanks,

Helps will be highly appreciated.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,247

Hi Nandini,

In FM SSFC_BASE64_DECODE

pass parameter b64leng = 0

In FM SSFC_BASE64_ENCODE

pass parameter binleng = 0

Hope this will solve your problem.

Regards

Ahsan

4 REPLIES 4
Read only

Former Member
0 Likes
1,248

Hi Nandini,

In FM SSFC_BASE64_DECODE

pass parameter b64leng = 0

In FM SSFC_BASE64_ENCODE

pass parameter binleng = 0

Hope this will solve your problem.

Regards

Ahsan

Read only

0 Likes
1,247

Thanks for the reply ashan..

But still the same problem.

Thanks.

Read only

0 Likes
1,247

Hi Nandini,

If you pass other than 0 in BINLENG this is happening, Check once without passing the value here.

B64LENG BINLENG leave them Empty they will take the Default Values and chek now

Test run in SE37 I did it by checking them and i am not getting it correct.

Nandini,

Instead use FM DECODE_SLDPWD_BASE64 and ENCODE_SLDPWD_BASE64

Check the below threads for some interesting Descussions

Check this one Aswell

/people/kathirvel.balakrishnan2/blog/2006/11/21/encryption-decryption-of-data-using-abap

Hope i have provided you what you are looking for, else search for some more results which serve your purpose.

Cheerz

Ram

Read only

Former Member
0 Likes
1,247

Hi Nandini,

Where did you get the first string (ABCD123) from? how do you know that string is a correct base64-encoded string?

You should encode something first and then decode it, not the other way around. If you encode first using SSFC_BASE64_ENCODE and then run FM SSFC_BASE64_DECODE with the output from the previous FM, it should return the original value.

Hope this helps.