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 function modules

Former Member
0 Likes
3,294

Hi

Please tell the function module names to Encrypt the code with key and Decrypt code with key.

i know these function module names

'FIEB_PASSWORD_ENCRYPT' and 'FIEB_PASSWORD_DECRYPT'

but its not working.

Is there any other function modules?

if it is not there please tell the documentation of the to create encrypt function module and decrypt function module.

Thanks.

Edited by: Craig Cmehil on Jul 18, 2008 10:01 AM

8 REPLIES 8
Read only

Former Member
0 Likes
1,807

Hi,

Use this function module

g_key TYPE i VALUE 26101957,

g_slen TYPE i,

g_slen = STRLEN( g_pwd ).

CALL FUNCTION 'HTTP_SCRAMBLE'

EXPORTING

SOURCE = g_pwd

sourcelen = g_slen

key = g_key

IMPORTING

destination = g_pwd.

Read only

0 Likes
1,807

Hi Mukesh,

Very thanks to your answer.

But here if i used to this logic for encryption, How to write the decript logic.

Please tell me.

Thanks.

Read only

0 Likes
1,807

This message was moderated.

Read only

0 Likes
1,807

try this it will do little bit closer to encription and decription

DATA:

g_key TYPE i VALUE 26101957,

g_slen TYPE i,

g_pwd type string VALUE 'Pass1234',

g_pwd1 type xstring ,

obj type ref to cl_http_utility.

CREATE OBJECT obj.

CALL METHOD obj->if_http_utility~encode_utf8

EXPORTING

unencoded = g_pwd

receiving

encoded = g_pwd1

EXCEPTIONS

conversion_failed = 1

others = 2

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CALL METHOD obj->if_http_utility~decode_utf8

EXPORTING

encoded = g_pwd1

receiving

unencoded = g_pwd

  • EXCEPTIONS

  • conversion_failed = 1

  • others = 2

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

write:/ g_pwd.

Read only

0 Likes
1,807

Hi Mukesh,

Thanks for your answer.

Please can you explain clearly.

Here what is import and export parameters?

Thanks

Read only

matt
Active Contributor
0 Likes
1,807

Try this link where you asked the same question last week.

matt

Read only

0 Likes
1,807

Hi Matthew,

Thanks for your answer.

I tried all function modules, but i didn't get proper one. that is the reason i posted a query this time is there any other possibility to create a encrypt and decrypt function function module.

Any one please tell me.

Thanks.

Read only

matt
Active Contributor
0 Likes
1,807

Fair enough.

There are a number of places on the web that have algorithms for en/decryption. It's not a trivial thing to write your own, but it would be possible.

matt