5/29/2012

Password Encryption

I found a bit non secured to have cleared passwords in the code, such as when we connect to a FTP using PutAttachement() function.  Here is a piece of code that shows how to encrypt and decrypt a password, the Integration Broker way (as available when configuring nodes, on the Connectors tab)

Local JavaObject &pscipher = CreateJavaObject("com.peoplesoft.pt.integrationgateway.common.EncryptPassword"); &pwd = "XXXX"; MessageBox(0, "", 0, 0, "Password before encryption " | &pwd); &encPassword = &pscipher.encryptPassword(&pwd); &yo = &pscipher.isPasswordEncrypted(&encPassword); &pscipher = Null; MessageBox(0, "", 0, 0, "Encrypted Password " | &encPassword | " " | &yo); Local JavaObject &psCYPHER = CreateJavaObject("psft.pt8.pshttp.PSCipher"); &DecPwd = &psCYPHER.decodePassword(&encPassword); MessageBox(0, "", 0, 0, "&DecPwd " | &DecPwd);

No comments:

Post a Comment