How to encrypt weblogic password.

来源:互联网 发布:社交软件 系统架构 编辑:程序博客网 时间:2024/06/08 16:12

1> weblogic encrypt Introduction

The weblogic.security.Encrypt utility encrypts cleartext strings for use with Oracle WebLogic Server. The utility uses the encryption service of the current directory, or the encryption service for a specified Oracle WebLogic Server domain root directory.

Note:
An encrypted string must have been encrypted by the encryption service in the Oracle WebLogic Server domain where it will be used. If not, the server will not be able to decrypt the string.

You can only run the weblogic.security.Encrypt utility on a machine that has at least one server instance in an Oracle WebLogic Server domain; it cannot be run from a client.

Note:
Oracle recommends running the utility from the Administration Server domain directory or on the machine hosting the Administration Server and specifying a domain root directory.
Syntax

java [-Dweblogic.RootDirectory=dirname]
     [-Dweblogic.management.allowPasswordEcho=true]
       weblogic.security.Encrypt [password]

Table 2-5 describes the arguments that are passed to the weblogic.security.Encrypt utility.

Table 2-5 Encrypt Arguments
Argument     Definition

dirname

    

Optional. Oracle WebLogic Server domain directory in which the encrypted string will be used. If not specified, the default domain root directory is the current directory (the directory in which the utility is being run).

weblogic.management.allowPasswordEcho

    

Optional. Allows echoing characters entered on the command line. weblogic.security.Encryptexpects that no-echo is available; if no-echo is not available, set this property to true.

password

    

Optional. Cleartext string to be encrypted. If omitted from the command line, you will be prompted to enter a password.

Examples

The utility returns an encrypted string using the encryption service of the domain located in the current directory.

java weblogic.security.Encrypt xxxxxx
{AES}yWv/i0qhfM4/IvzoghzjHj/xpJUkQPF8OWuSfh0f0Ss=

The utility returns an encrypted string using the encryption service of the specified domain location.

java -Dweblogic.RootDirectory=./mydomain weblogic.security.Encrypt xxxxxx
{AES}wr86u9Z5DHr+5p7WIbzTDSy4M/sl7EYnX/K5xzcarDQ=

The utility returns an encrypted string in the current directory, without echoing the password.

java weblogic.security.Encrypt
Password:
{AES}LIX8hoiStcAhph0PGCpveouw/0UO0lciODuj+TQh/bs=

2> Usage

cd domain
cd bin
. ./setDomainEnv.sh
java weblogic.security.Encrypt
Password: (enter password here)
{AES}aRC9klq8c5CljKpshacfrsc7WFNB49mfQG+MtuCDgFg=

you can now use the AES password in all weblogic files, but before Oracle11g, we can only use 3DES encryption algorithm.