- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我尝试在我的 Jasypt 中使用 3DES,但遇到异常。
但是当我使用默认算法时它工作正常
这是代码 -
public MyEncryptablePropertyResolver(Environment environment) {
char[] password = "password".toCharArray();
this.encryptor = new PooledPBEStringEncryptor();
SimpleStringPBEConfig config = new SimpleStringPBEConfig();
config.setPasswordCharArray(password);
config.setAlgorithm("PBEWithMD5AndTripleDES");
config.setKeyObtentionIterations("1000");
config.setPoolSize(1);
config.setProviderName("SunJCE");
config.setSaltGeneratorClassName("org.jasypt.salt.RandomSaltGenerator");
config.setStringOutputType("base64");
encryptor.setConfig(config);
}
这是一个异常(exception)
org.jasypt.exceptions.EncryptionOperationNotPossibleException: null
at org.jasypt.encryption.pbe.StandardPBEByteEncryptor.decrypt(StandardPBEByteEncryptor.java:1055) ~[jasypt-1.9.2.jar:na]
at org.jasypt.encryption.pbe.StandardPBEStringEncryptor.decrypt(StandardPBEStringEncryptor.java:725) ~[jasypt-1.9.2.jar:na]
at org.jasypt.encryption.pbe.PooledPBEStringEncryptor.decrypt(PooledPBEStringEncryptor.java:498) ~[jasypt-1.9.2.jar:na]
at com.platform.core.config.PlatformEncryptionConfiguration$MyEncryptablePropertyResolver.resolvePropertyValue(PlatformEncryptionConfiguration.java:51) ~[classes/:na]
at com.ulisesbocchio.jasyptspringboot.resolver.DefaultLazyPropertyResolver.resolvePropertyValue(DefaultLazyPropertyResolver.java:41) ~[jasypt-spring-boot-2.0.0.jar:na]
at com.ulisesbocchio.jasyptspringboot.EncryptablePropertySource.getProperty(EncryptablePropertySource.java:16) ~[jasypt-spring-boot-2.0.0.jar:na]
at com.ulisesbocchio.jasyptspringboot.wrapper.EncryptableMapPropertySourceWrapper.getProperty(EncryptableMapPropertySourceWrapper.java:29) ~[jasypt-spring-boot-2.0.0.jar:na]
at org.springframework.core.env.CompositePropertySource.getProperty(CompositePropertySource.java:59) ~[spring-core-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.springframework.cloud.bootstrap.BootstrapApplicationListener$ExtendedDefaultPropertySource.getProperty(BootstrapApplicationListener.java:430) ~[spring-cloud-context-1.3.0.RELEASE.jar:1.3.0.RELEASE]
at com.ulisesbocchio.jasyptspringboot.EncryptablePropertySource.getProperty(EncryptablePropertySource.java:13) ~[jasypt-spring-boot-2.0.0.jar:na]
at com.ulisesbocchio.jasyptspringboot.wrapper.EncryptableMapPropertySourceWrapper.getProperty(EncryptableMapPropertySourceWrapper.java:29) ~[jasypt-spring-boot-2.0.0.jar:na]
at org.springframework.boot.bind.PropertySourcesPropertyValues.getEnumerableProperty(PropertySourcesPropertyValues.java:165) ~[spring-boot-1.5.7.RELEASE.jar:1.5.7.RELEASE]
at org.springframework.boot.bind.PropertySourcesPropertyValues.processEnumerablePropertySource(PropertySourcesPropertyValues.java:148) ~[spring-boot-1.5.7.RELEASE.jar:1.5.7.RELEASE]
at org.springframework.boot.bind.PropertySourcesPropertyValues.processPropertySource(PropertySourcesPropertyValues.java:127) ~[spring-boot-1.5.7.RELEASE.jar:1.5.7.RELEASE]
at org.springframework.boot.bind.PropertySourcesPropertyValues.<init>(PropertySourcesPropertyValues.java:117) ~[spring-boot-1.5.7.RELEASE.jar:1.5.7.RELEASE]
at org.springframework.boot.bind.PropertySourcesPropertyValues.<init>(PropertySourcesPropertyValues.java:78) ~[spring-boot-1.5.7.RELEASE.jar:1.5.7.RELEASE]
at org.springframework.boot.bind.PropertySourcesPropertyValues.<init>(PropertySourcesPropertyValues.java:66) ~[spring-boot-1.5.7.RELEASE.jar:1.5.7.RELEASE]
at org.springframework.cloud.client.HostInfoEnvironmentPostProcessor.getFirstNonLoopbackHostInfo(HostInfoEnvironmentPostProcessor.java:47) ~[spring-cloud-commons-1.3.0.RELEASE.jar:1.3.0.RELEASE]
at org.springframework.cloud.client.HostInfoEnvironmentPostProcessor.postProcessEnvironment(HostInfoEnvironmentPostProcessor.java:34) ~[spring-cloud-commons-1.3.0.RELEASE.jar:1.3.0.RELEASE]
at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEnvironmentPreparedEvent(ConfigFileApplicationListener.java:182) ~[spring-boot-1.5.7.RELEASE.jar:1.5.7.RELEASE]
at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEvent(ConfigFileApplicationListener.java:168) ~[spring-boot-1.5.7.RELEASE.jar:1.5.7.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) ~[spring-context-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) ~[spring-context-4.3.11.RELEASE.jar:4.3.11.RELEASE]
最佳答案
如果您使用的是 TripleDES,请确保您已为 JDK 安装了 Java 加密扩展。 http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html
关于java - Jasypt org.jasypt.exceptions.EncryptionOperationNotPossibleException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51223921/
几天前,我提出了一个有关 Jasypt 问题的问题。我引用了一个抛出 EncryptionOperationNotPossibleException 的较大程序。嗯,我还是没能弄清楚问题所在。这是正在
我在我的 Spring Boot 应用程序中使用 Jasypt 和 BouncycaSTLe。我可以正常运行我的应用程序,并且加密的内容会添加到数据库中。 但是,在运行单元测试时,我得到: org.j
我正在使用 Jasypt API(版本 1.9.2)进行加密和解密。在使用命令行界面工具列出算法时,我得到以下列表。 listAlgorithms.bat PBE ALGORITHMS: [
我将 Jasypt-1.9.0 与 Spring 3.1 和 Hibernate 4.0.1 一起使用。我的应用程序需要连接到数据库,其密码(root)以加密形式存储在应用程序的属性文件中。 我上网查
我尝试在我的 Jasypt 中使用 3DES,但遇到异常。 但是当我使用默认算法时它工作正常 这是代码 - public MyEncryptablePropertyResolver(Environme
我尝试检查我之前加密过的密码,但出现异常,我不知道为什么。 这是我用来加密密码的方法: @Service("XEncryptor") public class XEncryptor { pri
我尝试使用 Jasypt与 Bouncy Castle crypro 在 Spring 应用程序中提供(128 位 AES)来解密实体属性,同时使用 Hibernate 保存它们。但是当尝试保存实体时
我正在使用 Jasypt 加密库来加密/解密一些文本。此代码嵌入到 WAR 文件中并部署到服务器。 在本地运行时,在单元测试中,加密/解密循环工作得很好。我使用 Jetty 来开发应用程序。该代码在该
我已经在我的网络应用程序的服务器代码中一次又一次地使用了此代码或类似的代码,但现在我正在尝试创建一个命令行实用程序来与维护后端一起使用。 继续收到EncryptionOperationNotPossi
我真的很难解决这个错误:有人可以帮助我吗? 我使用了 jasypt 标准...请帮助。用过这个:http://www.jasypt.org/ ENC : 0Ex+dkccYbqFQOmNrg93pok
我是一名优秀的程序员,十分优秀!