‎2008 Aug 11 11:26 AM
Hi,
I am writing an application that requires a username and password input via a WebDynpro UI.
I would like to convert this data to a hexadecimal format during passing these value to the API function
that needs them. And convert them back to string format just before calling the target API function.
This would at least prevent displaying the password in plain text in the debugger, which would be a dramatic security issue.
Any idea's?
kind regards,
Sahla
‎2008 Aug 11 11:31 AM
Hi,
Try FM
FIEB_PASSWORD_ENCRYPT
FIEB_PASSWORD_DECRYPT
Regards,
Mohaiyuddin
‎2008 Aug 11 11:31 AM
Hi,
Try FM
FIEB_PASSWORD_ENCRYPT
FIEB_PASSWORD_DECRYPT
Regards,
Mohaiyuddin
‎2008 Aug 11 12:06 PM
Hi,
Thanks a lot. But this FM's do not exist on my System.
Are they a part of SAP Basis?
kind regards,
Sahla
‎2008 Aug 11 12:17 PM
Hi Sahla,
It is available in R/3, which version are you using. I don't know if they are available in < 4.7.
These are function modules provided by SAP for encrypting and decrypting passwords.
Available under Function Group
FIEB_PASSWORD
Can you check through se80, if this Function Group is available in your system ?
Regards,
Mohaiyuddin
‎2008 Aug 11 12:20 PM
Hi,
I am developping in solution manager environment using ABAP Basis release 701.
The function group does not exist in se80.
Any suggestions?
kind regards,
Sahla
‎2008 Aug 11 12:34 PM
‎2008 Aug 11 12:40 PM
Hi,
Is there any dependencies on other R/3 specific functions?
Is it possible to post me the source code?
kind regards,
Sahla
‎2008 Aug 11 12:47 PM
Hi,
Can you try find these FMs
UIPW_DECRYPT
UIPW_ENCRYPT
They are available under Function Group UIPW. I think these are specific for UI.
Regards,
Mohaiyuddin
‎2008 Aug 11 12:50 PM
Hi,
No, they are not available on the SMF system
regards,
Sahla
‎2008 Aug 11 12:59 PM
Hi Sahla,
I don't know if i can copy SAP Standard code and paste it. I can give my own logic for password encryption / decryption (you can do it in thousand ways).
Regards,
Mohaiyuddin
‎2008 Aug 11 12:51 PM
Hi Sahla,
please check the code below to see how to cast characters into hex:
data: len type i,
off type i,
hex1(20) type x.
data asci_str(100) type c.
field-symbols <fs> type any.
asci_str = 'abdgFÜu676!·(FPP'.
len = strlen( asci_str ).
while off lt len.
assign asci_str+off(1) to <fs> casting type x.
hex1+off(1) = <fs>.
add 1 to off.
endwhile.
write: / hex1.
write: / asci_str.
‎2008 Aug 11 1:13 PM
Hi Karol,
The encoding works fine. What's about conversion back to character?
kind regards,
Sahla
‎2008 Aug 11 1:23 PM
Hi Sahla,
to convert it back use casting type c:
data: len type i,
off type i,
hex1(20) type x,
str(20) type c.
data asci_str(100) type c.
field-symbols <fs> type any.
asci_str = 'abdgFÜu676!·(FPP'.
len = strlen( asci_str ).
while off lt len.
assign asci_str+off(1) to <fs> casting type x.
hex1+off(1) = <fs>.
add 1 to off.
endwhile.
off = 0.
while off lt len.
assign hex1+off(1) to <fs> casting type c.
str+off(1) = <fs>.
add 1 to off.
endwhile.
write: / asci_str.
write: / hex1.
write: / str.
Regards,
Karol
‎2008 Aug 11 1:39 PM
Hi,
I get the message:
The length of "hex1" in bytes must be a multiple of the size of a unicode character, regardless of the size of the Unicode character.
I don't get thepoint ofthis message!??
kind regards,
Sahla
‎2008 Aug 11 1:52 PM
Hi,
i don't get this message. I guess it is just warning and program is working. Is it correct?
The message says that length of variable hex1 must be bigger then str because hex value is represented in more bytes. Just change the declaration of hex1 length and try again. For example 40.
Karol
‎2008 Aug 11 2:24 PM
Hi Karol,
unfortunately the error remains. It is an error and not a warning.
I changes the size to 40, 60 , 100. the error always heppens.
kind regards,
Sahla
‎2008 Aug 11 2:33 PM
Hi,
that's very strange for me. Unfortunately it is very difficult for me to find a problem because I get no error message. Try this code where output string in without length:
data: len type i,
off type i,
hex1(20) type x,
str type string.
data asci_str(10) type c.
field-symbols <fs> type any.
asci_str = 'abdgFÜu676'.
len = strlen( asci_str ).
while off lt len.
assign asci_str+off(1) to <fs> casting type x.
hex1+off(1) = <fs>.
add 1 to off.
endwhile.
off = 0.
while off lt len.
assign hex1+off(1) to <fs> casting type c.
concatenate str <fs> into str.
add 1 to off.
endwhile.
write: / asci_str.
write: / hex1.
write: / str.
If you have still error please copy whole text of error message here...
Regards,
Karol