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: 

Storing Passwords in custom tables

Former Member
0 Kudos

Hi,

We are developing a tool, that needs userID and pssword to access it.

So we want to store the information in a custom table. The maximum length of the password is 10 characters.

I used the function module to scrammble the password, but when I put this hexa value in a raw field defined in the custom table, then it adds Zero's at the end based on the length of the password. When I want to use this for checking the access I am facing the problem due to the Zero's at the end.

For example:

Passowrd : test@123

Scramble String: A3ED2E10FF13695E

When I store this in table it will be A3ED2E10FF13695E0000

I used a domain with data type RAW 10 for the password field. SAP USR02 table uses RAW 08.

Q1: How can I eliminate zero's at the end while storing it? I didn't wan to manually remove the trialing zero's while checking the access. This might cause problems becuase if the string it self contains a last character as zero.

Q2. Is there is a way to get back the original string from the scramble string.

Appreicate your ideas on this.

Thanks

9 REPLIES 9

Former Member
0 Kudos

Hi,

Check this thread which uses methods for encryption and decryption -

ashish

Former Member
0 Kudos

Ashish,

We are using the SAP 4.6C system and there is no class with the name cl_http_utility in it.

I am looking for the best way to store and retrieve the passwords.

Thanks

0 Kudos

You shouldn't be able to decrypt back the password, because, then anyone could do it by calling the relevant method or function module.

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 (which also was encypted using the FM).

Regards

Former Member
0 Kudos

I need decryption as well, because I need to send this password to the SAP standard function module. That is the reason why I am using the scramble, SAP takes the scramble word for the passord in a function module.

0 Kudos

Hi,

You can use the Function Modules 'FIEB_PASSWORD_ENCRYPT' and 'FIEB_PASSWORD_ENCRYPT' .

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

Reward Points if useful.

Regards,

Abhishek

0 Kudos

Hi,

You can use the Function Modules 'FIEB_PASSWORD_ENCRYPT' and

'FIEB_PASSWORD_DECRYPT' .

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

Reward Points if useful.

Regards,

Abhishek

Former Member
0 Kudos

I am still looking for a suitable answer for this requirment.

Former Member
0 Kudos

why cant u try RAW 8 in your table field??

Former Member
0 Kudos

Sreejith,

I can't use the RAW 08, because for some of the websites we access has passwords upto 10 character length.

Thanks