'{ name : "jackson", age : "32", cars : ["car1", "car2", "car3"], location : "california" } ' Above JSON string does not encrypt/Decrypt properly if there is "{" or "}" special charector.But if i try below string it does encrypt and decrypt properly.Can you please confirm if that is an expected behavior. 'name : "jackson", age : "32", cars : ["car1", "car2", "car3"], location : "california" '

Comment From: spencergibb

Can you provide more details please? What version are you using? How are you encrypting/decrypting? What are the steps to reproduce?

Comment From: va4330

Thanks for the response. 1.3.3.RELEASE is the version This is the url am using for Encrypt and Decrypt (From POSTMAN) http://localhost:8888/encrypt http://localhost:8888/decrypt content-type : test/plain POST Passing the values in the body.

Data Input Based on scenario Working Scenario 'name : "jackson", age : "32", cars : ["car1", "car2", "car3"], location : "california" '

Not Working Scenario

'{ name : "jackson", age : "32", cars : ["car1", "car2", "car3"], location : "california" } '

Comment From: spencergibb

The "Not Working Scenario" does what?

Comment From: va4330

Sorry, i forgot to mention the response. Response would be single quote '

Comment From: spencergibb

I believe the data needs to be urlencoded.

Comment From: spencergibb

See the notes in this section http://cloud.spring.io/spring-cloud-static/Edgware.RELEASE/single/spring-cloud.html#_encryption_and_decryption_2

Comment From: spencergibb

Closing this due to inactivity. Please re-open if there's more to discuss.

Comment From: paladan-artium

I also experienced this issue and can elaborate.

My project uses a JSON string for our Google API credentials, which is what Google provides you when downloading your credentials from their console. Upon attempting to migrate this from an environment variable used by our application.yml to Spring Cloud Config, I found myself stuck on attempting to encrypt the JSON as a string.

For example, hitting the /encrypt endpoint with an explicit content type of text/plain and the JSON {"taco": example"} results in a response of {"taco":example"}a22ce249141f040fbcc9f64ff54d1a2d8cd51b1c02558f9b3dd025d297001e62

I was able to get this to 'successfully' encrypt if I passed an escape character in front of the first bracket. \{"taco": example"} which resulted in 16124ce3c1ceeee8a903b837d1870e1a5ffd3b28520fca16036803bd577cb3614539c4955317eba8870cfeff1d59cbbb

Unfortunately, when the client application attempts to use the decrypted value from the config server it then fails to parse the JSON correctly because of the initial escape character.

My Spring Boot version is 2.2.4.RELEASE and Spring Cloud version is Hoxton.SR1.