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.

Former Member
0 Likes
628

Hiii Everybody,

I want to encrypt the following code. How can i do it?? can anybody give me a code that encrypts the following code into bytes,characters and spl characters,so that my encryption is strong and tough 2 decrypt.

The below code is just a sample code. Thanks in advance.

REPORT ZTST.

Parameters: rd1 RADIOBUTTON group g1 default 'X' user-command ch ,

rd2 RADIOBUTTON group g1 ,

rd3 RADIOBUTTON group g1 ,

kishan1(10) type c modif id ID1.

AT SELECTION-SCREEN.

check sy-ucomm = 'CH'.

AT SELECTION-SCREEN output.

IF rd1 = 'X' or rd2 = 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'ID1' .

screen-active = '1'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

IF RD3 = 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'ID1' .

screen-active = '0'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

5 REPLIES 5
Read only

Former Member
0 Likes
594

try this.

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.

regards,

vijay

Read only

0 Likes
594

Hiiii Vijay.

Thanks for ur reply. but i dont want to use any function modules or tables for this purpose. the reason being if the user comes to know that i have used function module to encrypt he can use dat to decrypt as well !!! which is not the purpose i want to achieve. and i have to do this in version < 4.7.

Read only

0 Likes
594

okay like u want to achieve this for encrypting but it has to be stored somewhere so i thought this FM might be handy ..

then u need to develop a sequence like in ASCII format so that it has to be decoded when needed.

never tried it but can change the sequence of ascii value 65 to some other value and store it where in all the change for the range remains same .

see if this works.

regards,

vijay

Read only

0 Likes
594

Thank you vijay:)

Read only

Former Member
0 Likes
594

BY encryption, what do you want to achieve?

If you want your code to be hidden , there is a way to hide it. Search the forum with the search string 'HIde abap code'.

Regards,

ravi