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 - Decrypt the Passwords

Former Member
0 Likes
7,733

Hi,

i am developing an integration between SAP and SFTP.

i want to save the encrypted password of SFTP to database tables and then i want to use the decrypted password to connect SFTP.

how to convert the encrypted password to decrypted?

can somebody help me please?

Best regards.

4 REPLIES 4
Read only

Former Member
0 Likes
3,849

Hi

you will have to encrypt the entered password first and compare the encrypted passwords.

Im not sure, but maybe FM VRM_COMPUTE_MD5 will do the encrypting-job.

just check it out and also check below FM

Try the DB_CRYPTO_PASSWORD function module, there's no way to decrypt it back that I know of. You just pass the user input to the function module and compare the encrypted output to the value stored in the database.

and also try this two

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.

Warm Regards

NZAB

Read only

Former Member
0 Likes
3,849

HI,

Use the following FM to encrypt

CALL FUNCTION 'FIEB_PASSWORD_ENCRYPT'

Use the following FM to decrypt

CALL FUNCTION 'FIEB_PASSWORD_DECRYPT'

Read only

Former Member
0 Likes
3,849

Hi,

i found code below and solved;

**--Password

clear v_ac_string . v_ac_string = S_PASS .

TRY.

CALL METHOD o_encryptor->encrypt_string2string

EXPORTING

the_string = v_ac_string

RECEIVING

result = i_data-password.

CATCH cx_encrypt_error INTO o_cx_encrypt_error.

CALL METHOD o_cx_encrypt_error->if_message~get_text

RECEIVING

result = v_error_msg.

MESSAGE v_error_msg TYPE 'E'.

ENDTRY.

**--password

CLEAR v_dec_string . CLEAR v_ac_string .

v_ac_string = i_data-password .

TRY.

CALL METHOD o_encryptor->decrypt_string2string

EXPORTING

the_string = v_ac_string

RECEIVING

result = v_dec_string.

CATCH cx_encrypt_error INTO o_cx_encrypt_error.

CALL METHOD o_cx_encrypt_error->if_message~get_text

RECEIVING

result = v_error_msg.

MESSAGE v_error_msg TYPE 'E'.

ENDTRY.

password = v_dec_string.

Read only

0 Likes
3,849

Hi,

you can use this class for encryption and decryption passwords

class->CL_HARD_WIRED_ENCRYPTOR

regards

venkatesh