Application Development 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: 

Encoding password

Former Member
0 Kudos
1,199

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos
132

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

2 REPLIES 2

Former Member
0 Kudos
132

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.

Former Member
0 Kudos
133

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