2006 Jul 05 8:11 AM
Hi alltogether,
I have some problems by encoding a password.
I have a Login with username and password.
Username and password are saved in a table.
Now, how can I save the password encrypted in the table and how can later the system decrypt the password to verify the password the user has entered?
I hope someone can help me.
Regards
Andreas
2006 Jul 05 8:20 AM
Hi Andreas,
Consider this code. It uses class <b>CL_HTTP_UTILITY</b>.
Just execute this code in SE38.
REPORT zarun_pass .
PARAMETERS : pass(32) TYPE c.
DATA : passwd TYPE string,
encoded TYPE string,
decoded TYPE string.
passwd = pass.
CONDENSE passwd.
CALL METHOD cl_http_utility=>if_http_utility~encode_base64 "Method for Encryption
EXPORTING
unencoded = passwd
RECEIVING
encoded = encoded.
CALL METHOD cl_http_utility=>if_http_utility~decode_base64 "Method for Decryption
EXPORTING
encoded = encoded
RECEIVING
decoded = decoded.
WRITE : / 'Password Entered :' , pass,
/ 'Encrypted Password :' , encoded,
/ 'Decrypted Password :' , decoded.
Regards,
Arun Sambargi.
Message was edited by: Arun Sambargi
2006 Jul 05 8:13 AM
please check the following:
Data enpwd(32) type c.
parameter pwd like enpwd .
enpwd = pwd.
******** Encrypting *******************
CALL FUNCTION <b>'FIEB_PASSWORD_ENCRYPT'</b>
EXPORTING
IM_DECRYPTED_PASSWORD = enpwd
IMPORTING
EX_ENCRYPTED_PASSWORD = enpwd
.
clear pwd.
******** Decrypting *******************
CALL FUNCTION <b>'FIEB_PASSWORD_DECRYPT'</b>
EXPORTING
IM_ENCRYPTED_PASSWORD = enpwd
IMPORTING
EX_DECRYPTED_PASSWORD = pwd.
write 😕 pwd.
2006 Jul 05 8:20 AM
Hi Andreas,
Consider this code. It uses class <b>CL_HTTP_UTILITY</b>.
Just execute this code in SE38.
REPORT zarun_pass .
PARAMETERS : pass(32) TYPE c.
DATA : passwd TYPE string,
encoded TYPE string,
decoded TYPE string.
passwd = pass.
CONDENSE passwd.
CALL METHOD cl_http_utility=>if_http_utility~encode_base64 "Method for Encryption
EXPORTING
unencoded = passwd
RECEIVING
encoded = encoded.
CALL METHOD cl_http_utility=>if_http_utility~decode_base64 "Method for Decryption
EXPORTING
encoded = encoded
RECEIVING
decoded = decoded.
WRITE : / 'Password Entered :' , pass,
/ 'Encrypted Password :' , encoded,
/ 'Decrypted Password :' , decoded.
Regards,
Arun Sambargi.
Message was edited by: Arun Sambargi