thermoweb / jasypt-encrypt-plugin

An IntelliJ plugin to encrypt/decrypt string using jasypt
MIT License
3 stars 0 forks source link

[BUG] Decryption with the lock icon #16

Closed markfodor closed 6 months ago

markfodor commented 6 months ago

Describe the bug Hey, I have noticed a strange bug with the decryption. Short description below, but ask please if you have problems to reproduce.

To Reproduce

  1. Copy this json to an env file: {"keys":[{"kty":"oct","use":"enc"}]}
  2. Encrypt the whole json
  3. It displays: ENC(...)
  4. Click on the little green icon next to the line number
  5. You should see this string as decrypted text: "oct" image

Expected behavior We should see the whole json after clicking the green lock icon.

Desktop (please complete the following information):

Additional context Strange thing is that it works just fine if I select the whole text ( ENC(...) ) and select the "Decrypt String" menu item in the dropdown list after a right click.

thermoweb commented 6 months ago

Hi,

Sorry for my late answer, I was in holidays.

I just try your issue. I reproduced it. But it seems weird to have plain json in a YAML file. I never used that before and I see that it's recommended to wrap the json between simple quotes like this:

app:
  block:
    title: test
    description: '{ "keys": [ { "kty": "oct","use": "enc" } ] }'

The issue is due to the text conversion into YAML property by the lib used by IntelliJ to hand YAML files. It's not happening when you use the "Decrypt String" menu item, because it's just directly replacing seletected text by the uncrypted one (so no YAML conversion).

markfodor commented 6 months ago

Hmm, you are right. It really works fine when it is between quotes. I will tell the guys in the team :)