B953000 - Encrypt Decrypt BSFN works in Interactive App. Does not work in UBE

Jde Kumar

Member
HI Friends - We are using B953000 BSFN to encrypt and decrypt some data. This BSFN works fine (both encryption and decryption) when we use it in an Interactive Application. However, when we use the same BSFN to decrypt the value in an UBE, it is unable to decrypt it. We tried changing the BSFN flag to Client / Server and removed the OCM mapping to run locally. Any help will be highly appreciated.

Regards
Sam

E1 8.12 Tools: 8.98
 
Hi Sam,

it looks like B953000 is a web-only function.

If you check it's code you'll notice there's actually nothing functional in it.

Executing it from a local web application with debug logging turned on, you'll notice that there's no BSFN call at all in any of your jdedebug logs, or if there is it doesn't do anything. While if for example you pass invalid values for decrypting, you can see messages in the jas.log like "Error executing decryptValue BSFN. com.jdedwards.system.security.util.TripleDESUtilityException...", so it's most likely that there's a JAS function that does it all in the background.

I would expect that any non-web process calling it remotely, for example calling it from UBE or calling it from another BSFN, would execute the C-BSFN which doesn't do anything at all.

You may want to write your own C-BSFN using the API functions jdeEncryptWKey() and jdeDecryptWKey(), these should work from UBEs too.

Best Regards
 
Actually, the function is pair of API calls; encrypt / decrypt.

If you go to the kg, and type in the function id, there is an esu specific to web crashes.

(db)
 
HI - Thanks a lot for your reply. You are right. I do not see any code in there and it does not show up the debug logs.

I did try to use the jdeEncryptWKey() and jdeDecryptWKey() and created a custom BSFN. This bsfn encrypts the data fine. However, when I store the encrypted value in a table and then fetch it to decrypt, it fails intermittently. It comes up with web client exception errors. Did you use these APIs by any chance? My requirement is to store the encrypted value in a table using an Interactive App and then decrypt it to write to a flat file from another UBE. Any help is highly appreciated.
 
Hi, yes I used these before. The only caveat I noticed back then was that the first parameter (output string) to the jdeDecryptWKey seemed internally to be used to temporarily hold the encrypted string, thus it should be large enough for that. And for a reason I don't remember I explicitely limited the sixth parameter (key length) of both functions to a maximum of 16, though this might have been related to some other requirements.

Best Regards
 
Another thought..., the encrypted value is actually a BYTE array which might contain zeroes. If you're going to store that in a table then it might be a good idea to either use a BLOB field or otherwise run some base64 encoding first.
 
Thanks everyone for the knowledge shared on this post.
lpDoDecryption/lpDoEncryption worked like a charm
Only problem is, these APIs convert you password into upper case. So you cannot enter a password that is in lower case.
Does anyone have any workaround?
 
Back
Top