Encrypting a string in weblogic

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.

5 Responses to “Encrypting a string in weblogic”

  1. arunkumar says:

    We created a userid in weblogic with some role and policy . We need a use this user id and password in our java code to connect to the server to destroy the JMS session

    Our business user told to us not to user clear text password. I know we can encrypt the weblogic password using the below utility

    weblogic.security.Encrypt

    Is there is any utility to decrypt the password?

  2. Eran says:

    Arunkumar – Did you get an answer?
    I’m facing with the same problem, and urgently looking for an answer.

  3. sachvshah says:

    Hi,

    Can this utility be used for encrypting text other than the password for datasource. For e.g. encrypt a text, include the same as an attribute for a web application. When this web application is deployed will weblogic ensure this encrypted attribute is available to web application in cleartext at runtime?

    Sachin

  4. Satya Ghattu's Blog says:

    Arunkumar – apologize for a late reply. Unfortunately there is no public method to decrypt an encrypted password.

  5. Satya Ghattu's Blog says:

    Sachin – You can include the encrypted string, but unfortunately there is no public API to decrypt the password.