therockstorm / privacy-protect

Securely share and store passwords and sensitive files.
https://www.privacyprotect.dev/
MIT License
132 stars 16 forks source link

Newline in hint breaks decryption #69

Open kkzo opened 2 months ago

kkzo commented 2 months ago

Summary

Encrypted files generated with a hint that contains a new line (multiline hint) fail to decrypt with the correct password.

Reproduction steps

  1. Visit https://www.privacyprotect.dev/
  2. Set Secret type to Message and populate with example text.
  3. Set Password (red used in example)
  4. Set Password hint to a multiline note (set line one to one and two to two in this example)
  5. Generate and attempt to decrypt
  6. Open downloaded file and attempt to decrypt

Upon opening the encrypted file, the password hint is blank and message fails to decrypt with the chosen password.

Expected behavior

Upon opening the encrypted file, the password hint should be visible and the password should successfully decrypt the message.

Screenshots

Encrypt:

image

Decrypt:

image

Log:

2024-07-14T11_09_13.secret.html:189 Uncaught TypeError: Cannot read properties of undefined (reading 'passwordHint')
    at init (2024-07-14T11_09_13.secret.html:189:16)
    at onload (2024-07-14T11_09_13.secret.html:269:25)
init @ 2024-07-14T11_09_13.secret.html:189
onload @ 2024-07-14T11_09_13.secret.html:269

Device information