Archive for June, 2008

Encrypting a string in weblogic

Tuesday, June 24th, 2008

One of my developer was asked me this morning if he can encrypt a string so that he does not have to store a clear string in his scripts or variables while configuring resources especially JDBC connection pool’s. A quick and easy way to encrypt a String in WebLogic is to use the encrypt command in WLST.

import java.lang.System
encStr = encrypt(“mypassword”, java.lang.System.getenv(“DOMAIN_HOME”))

WLST internally calls the weblogic.security.Encrypt utility to encrypt the clear string. You can directly use this command line tool to encrypt the password and use the encrypted password in your scripts.