例如,而不是
<property name="hibernate.connection.username">user1</property>
<property name="hibernate.connection.password">password1</property>
我想要类似的东西
<property name="hibernate.connection.username">user1</property>
<property name="hibernate.connection.password">ENC(0HY4F73HFPQ85CN)</property>
我正在使用PBEWITHMD5ANDTRIPLEDES算法。我查阅了相关资料,发现可能需要安装JCE或“司法管辖策略”扩展。我的问题是,如果在我的PBE算法列表中看到这个算法,那么这些东西是否已经安装了?
我运行了listAlgorithms.bat脚本:
C:\dev\jasypt-1.9.1\bin>listAlgorithms.bat
DIGEST ALGORITHMS: [MD2, MD5, SHA, SHA-256, SHA-384, SHA-512]
PBE ALGORITHMS: [PBEWITHMD5ANDDES, PBEWITHMD5ANDTRIPLEDES, PBEWITHSHA1ANDDESEDE, PBEWITHSHA1ANDRC2_40]
但是当我尝试加密我的密码时,却收到一个非常没有帮助的错误信息:
C:\dev\jasypt-1.9.1\bin>encrypt.bat input=etrading_rw_123 password=encryptionkey algorithm=PBEWITHMD5ANDTRIPLEDES
----ENVIRONMENT-----------------
Runtime: Sun Microsystems Inc. Java HotSpot(TM) Client VM 20.14-b01
----ARGUMENTS-------------------
algorithm: PBEWITHMD5ANDTRIPLEDES
input: etrading_rw_123
password: encryptionkey
----ERROR-----------------------
Operation not possible (Bad input or parameters)
如果我使用algorithm=PBEWITHMD5ANDDES运行相同的脚本,它能正常工作。"支持的算法"列表实际上是指"如果您启用了它们,则会支持这些算法"而不是"可以投入使用的算法"吗?
我正在使用的Java版本:
java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode, sharing)