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

How to Encrypt

Former Member
0 Likes
955

Hiii Everybody,

We are developing a tool. in that for the client to enter a transaction he must enter the password. if the password is correct he is allowed to go inside the transaction. so i want to know is there any method using which i can encrypt the password in SAP. i dont want to use the function modules because it contains the decryption also. the decryption method must be known only to us and not the client. can somebody help me out on this??

Hiii Everybody,

We are developing a tool. in that for the client to enter a transaction he must enter the password. if the password is correct he is allowed to go inside the transaction. so i want to know is there any method using which i can encrypt the password in SAP. i dont want to use the function modules because it contains the decryption also. the decryption method must be known only to us and not the client. can somebody help me out on this??

8 REPLIES 8
Read only

Former Member
0 Likes
900

hi

check function group SECH

Regards

Deepak

Read only

0 Likes
900

can u explain me how to use that function group in detail..hope u don mind:)

Read only

0 Likes
900

hi,

reference ..

http://www.sap-img.com/abap/function-module-for-encryption-and-decryption.htm

Use the following FM to encrypt

CALL FUNCTION 'FIEB_PASSWORD_ENCRYPT'

Use the following FM to decrypt

CALL FUNCTION 'FIEB_PASSWORD_DECRYPT'

By these FM you can encrypt & decrypt any fields of the Program.

Two more things:

1. You can't use these FM to decode user passwords.

2. Although their import parameters are case sensitive, when you test them from se37, the import parameters are converted to uppercase (thus, it may seem that they aren't working). A suggestion: encapsulate them in a custom FM that receives a string to be encrytped/decrypted and a parameter that says if you want to encrypt or decrypt and call this fm from your program. Test them very carefully, because once the string has been encrypted the decryption side is the only way to get it back.

function zsecurtext. 
*"---------------------------------------------------------------------- 
*"*"Interfase local 
*"  IMPORTING 
*"     REFERENCE(INTEXT) TYPE  FIEB_DECRYPTED_PASSWD OPTIONAL 
*"     REFERENCE(ENCRYPT) TYPE  C OPTIONAL 
*"  EXPORTING 
*"     REFERENCE(OUTTEXT) TYPE  FIEB_DECRYPTED_PASSWD 
*"---------------------------------------------------------------------- 
** NOTE: This code doesn't work if run from se37. You should 
** encrypt 
  if encrypt = 'X'. 
    call function 'FIEB_PASSWORD_ENCRYPT' 
         exporting 
              im_decrypted_password = intext 
         importing 
              ex_encrypted_password = outtext. 
   else. 
******** Decrypting ******************* 
    call function 'FIEB_PASSWORD_DECRYPT' 
         exporting 
              im_encrypted_password = intext 
         importing 
              ex_decrypted_password = outtext. 
  endif. 
 
endfunction.

rgds

Anver

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
900
Read only

Former Member
0 Likes
900

Hi,

Did you try FM "FIEB_PASSWORD_ENCRYPT" ??

i think the client cannot use this to decrypt. So wheres the issue?

Cheers

VJ

Read only

0 Likes
900

Hiii vijay.

There's a FM FIEB PASSWORD DECRYPT..,,isnt it?? so if the client comes to know that i have used this FM for my encryption he can use the FM for decryption to decrypt it... can u please clarify on this??

Read only

0 Likes
900

Hi Venkat,

Guess then the best way is to write your own encryption logic or use third-party encryption tools to encryot the code.

a simple approach is to store the password in a custom table and do not gives access to read this table to client. This way you really dont need to encrypt the password.

Hope this makes sense.

Cheers

VJ

Read only

0 Likes
900

Hi vijay.

Thanks a lot for ur answers and time:)