ulisesbocchio / jasypt-spring-boot

Jasypt integration for Spring boot
MIT License
2.88k stars 514 forks source link

mvn jasypt:encrypt-value something wrong with special char $$ #229

Closed sophea closed 3 years ago

sophea commented 4 years ago

use manen plugin

 <plugin>
                <groupId>com.github.ulisesbocchio</groupId>
                <artifactId>jasypt-maven-plugin</artifactId>
                <version>3.0.3</version>
            </plugin>

The console output as below to encrypt the value "Pa$$w0rd123456"

 mvn jasypt:encrypt-value -Djasypt.encryptor.password="passw0rd" -Djasypt.plugin.value="Pa$$w0rd123456"

[INFO] Scanning for projects...
[INFO]
[INFO] -------------< com.jtrust.database.audit:pwoercard-audit >--------------
[INFO] Building pwoercard-audit 1.0.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- jasypt-maven-plugin:3.0.3:encrypt-value (default-cli) @ pwoercard-audit ---
[INFO] Starting MavenCli v3.6.2 on DESKTOP-R732NOD with PID 23972 (C:\apps\maven-3.6.2\lib\maven-embedder-3.6.2.jar started by Mak Sophea in D:\software\pwoercard-audit)
[INFO] No active profile set, falling back to default profiles: default
[INFO] Post-processing PropertySource instances
[INFO] Converting PropertySource configurationProperties [org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource] to AOP Proxy
[INFO] Converting PropertySource systemProperties [org.springframework.core.env.PropertiesPropertySource] to EncryptableMapPropertySourceWrapper
[INFO] Converting PropertySource systemEnvironment [org.springframework.boot.env.SystemEnvironmentPropertySourceEnvironmentPostProcessor$OriginAwareSystemEnvironmentPropertySource] to EncryptableSystemEnvironmentPropertySourceWrapper
[INFO] Converting PropertySource random [org.springframework.boot.env.RandomValuePropertySource] to EncryptablePropertySourceWrapper
[INFO] Property Filter custom Bean not found with name 'encryptablePropertyFilter'. Initializing Default Property Filter
[INFO] Started MavenCli in 0.993 seconds (JVM running for 3.63)
[INFO] Active Profiles: Default
[INFO] Encrypting value Pa497w0rd123456
[INFO] String Encryptor custom Bean not found with name 'jasyptStringEncryptor'. Initializing Default String Encryptor
[INFO] Encryptor config not found for property jasypt.encryptor.algorithm, using default value: PBEWITHHMACSHA512ANDAES_256
[INFO] Encryptor config not found for property jasypt.encryptor.key-obtention-iterations, using default value: 1000
[INFO] Encryptor config not found for property jasypt.encryptor.pool-size, using default value: 1
[INFO] Encryptor config not found for property jasypt.encryptor.provider-name, using default value: null
[INFO] Encryptor config not found for property jasypt.encryptor.provider-class-name, using default value: null
[INFO] Encryptor config not found for property jasypt.encryptor.salt-generator-classname, using default value: org.jasypt.salt.RandomSaltGenerator
[INFO] Encryptor config not found for property jasypt.encryptor.iv-generator-classname, using default value: org.jasypt.iv.RandomIvGenerator
[INFO] Encryptor config not found for property jasypt.encryptor.string-output-type, using default value: base64
[INFO]
ENC(H4riOPbkobb6Gvo1AgepO3FtL+e149Wi0bSGv79KJU4vhCaWR69bq2PfI6ZbQDaQ)

It says that the encrypting value is : Pa497w0rd123456 which is not Pa$$w0rd123456

ulisesbocchio commented 3 years ago

this is a problem with your terminal, you have to escape the $, try single quotes instead of the double ones