Bug 146947 - Ability to show/reveal characters being typed into password prompt to decrypt a document
Summary: Ability to show/reveal characters being typed into password prompt to decrypt...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Karthik
URL:
Whiteboard: target:25.8.0
Keywords: accessibility, difficultyMedium, easyHack, skillCpp, topicUI
Depends on:
Blocks: Password-Protected
  Show dependency treegraph
 
Reported: 2022-01-23 21:44 UTC by Jeff Fortin Tam
Modified: 2025-03-14 02:25 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff Fortin Tam 2022-01-23 21:44:20 UTC
Description:
When opening an encrypted document, such as a spreadsheet, LibreOffice prompts for the password/passphrase to decrypt it.

This is nice, but I have some documents where the passphrase is really long and I tend to misstype quite often. I would like to have a togglebutton (or checkbox, or GtkSwitch) in that password prompt that I can click to let the characters be plainly visible, when I know that I'm in a safe environment (i.e.: nobody looking over the shoulder, no screencasting/recording going on, not giving a presentation in a conference, etc.).

I'd be OK (and would recommend, in fact) with that toggle's state being off by default, so I would have to turn it on each time.

Steps to Reproduce:
Try to open an encrypted document.

Actual Results:
Characters are obscured by dots

Expected Results:
Being able to see the plain characters, if desired.


Reproducible: Always


User Profile Reset: No



Additional Info:
A button to allow seeing the characters as I type them.
Comment 1 Stéphane Guillou (stragu) 2023-05-30 23:52:14 UTC
Agree that this would be a welcome enhancement, and could possibly be an accessibility issue for users requiring more visual feedback.

Some useful information for best implementation: https://incl.ca/show-hide-password-accessibility-and-password-hints-tutorial/
Comment 2 Commit Notification 2025-01-10 12:05:21 UTC
Balazs Varga committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/6eb1a3c4b08f004c074dac41dee31bacb38216a5

tdf#146947 - UI: Ability to show/reveal characters being typed into

It will be available in 25.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 3 Buovjaga 2025-02-09 14:17:52 UTC
Balázs: I'm not seeing any toggle buttons in the decryption dialog. Tried with gtk3, kf6 and Windows. I even tested with the exact commit in Linux 25.8 bibisect repo. Please advise.

Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 36b4609461d9daa7cfd9b00689f64d31717e5044
CPU threads: 8; OS: Linux 6.13; UI render: default; VCL: gtk3
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: CL threaded
Comment 4 Balázs Varga (allotropia) 2025-02-10 08:37:04 UTC
(In reply to Buovjaga from comment #3)
> Balázs: I'm not seeing any toggle buttons in the decryption dialog. Tried
> with gtk3, kf6 and Windows. I even tested with the exact commit in Linux
> 25.8 bibisect repo. Please advise.
> 
> Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
> Build ID: 36b4609461d9daa7cfd9b00689f64d31717e5044
> CPU threads: 8; OS: Linux 6.13; UI render: default; VCL: gtk3
> Locale: fi-FI (fi_FI.UTF-8); UI: en-US
> Calc: CL threaded

Ohh yeah, thanks for the notice. The plan for this implementation didn't include the encryption/decryption dialog unfortunatelly, which is a different UI file (cui/uiconfig/ui/password.ui) but almost the same as the one in the patch: sfx2/uiconfig/ui/password.ui. So I didn't modify the cui/uiconfig/ui/password.ui file. To add this toggle button to encryption/decryption we just need to add basically the same things as in the sfx2/uiconfig/ui/password.ui and in the sfx2/source/dialog/passwd.cxx file. The other necessary bits (such as handling QT5, GTK3 etc..) were added in the https://git.libreoffice.org/core/commit/6eb1a3c4b08f004c074dac41dee31bacb38216a5 patch. So basically just an easy hack have left here. Unfortunatelly  I can see now that this bugticket related to only encryption/decryption dialog, so should not be closed yet. :)
Comment 5 Buovjaga 2025-02-11 17:04:41 UTC
(In reply to Balázs Varga (allotropia) from comment #4)
> (In reply to Buovjaga from comment #3)
> > Balázs: I'm not seeing any toggle buttons in the decryption dialog. Tried
> > with gtk3, kf6 and Windows. I even tested with the exact commit in Linux
> > 25.8 bibisect repo. Please advise.
> > 
> > Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
> > Build ID: 36b4609461d9daa7cfd9b00689f64d31717e5044
> > CPU threads: 8; OS: Linux 6.13; UI render: default; VCL: gtk3
> > Locale: fi-FI (fi_FI.UTF-8); UI: en-US
> > Calc: CL threaded
> 
> Ohh yeah, thanks for the notice. The plan for this implementation didn't
> include the encryption/decryption dialog unfortunatelly, which is a
> different UI file (cui/uiconfig/ui/password.ui) but almost the same as the
> one in the patch: sfx2/uiconfig/ui/password.ui. So I didn't modify the
> cui/uiconfig/ui/password.ui file. To add this toggle button to
> encryption/decryption we just need to add basically the same things as in
> the sfx2/uiconfig/ui/password.ui and in the sfx2/source/dialog/passwd.cxx
> file. The other necessary bits (such as handling QT5, GTK3 etc..) were added
> in the
> https://git.libreoffice.org/core/commit/
> 6eb1a3c4b08f004c074dac41dee31bacb38216a5 patch. So basically just an easy
> hack have left here. Unfortunatelly  I can see now that this bugticket
> related to only encryption/decryption dialog, so should not be closed yet. :)

Aha. Well, this is a good example why bug report titles should not be copied to commit messages.

Can you tell what we should do in the UI to see the toggle button currently?
Comment 6 Buovjaga 2025-02-12 14:16:04 UTC
(In reply to Buovjaga from comment #5)
> Aha. Well, this is a good example why bug report titles should not be copied
> to commit messages.
> 
> Can you tell what we should do in the UI to see the toggle button currently?

Forgot to add Balázs back to Cc.
Comment 7 Balázs Varga (allotropia) 2025-02-12 15:55:36 UTC
> Aha. Well, this is a good example why bug report titles should not be copied
> to commit messages.
> 
> Can you tell what we should do in the UI to see the toggle button currently?

Yeah, agree, it could be very confusing and misleading.

So two things need to be added:

First need to change the other password UI file: cui/ui/password.ui, basically the same as it was changed in the patch with the sfx2/uiconfig/ui/password.ui file. The password text fields need to be inserted in a horizontal two column gtk box. The first column of the gtk box contains the original password textfield and the second gtk column can contain the toggle button. Then need to add the "eye" image to the toggle button, as it was added in the patch with the sfx2/uiconfig/ui/password.ui. The images already added to our repo: see: icon-themes/colibre/res/showpass.png and icon-themes/colibre/res/hidepass.png files.

The second part is also basically the same what I did in the sfx2/source/dialog/passwd.cxx file in the patch, but for this specific issue need to be done in cui/source/dialogs/passwdomdlg.cxx

https://opengrok.libreoffice.org/xref/core/cui/source/dialogs/passwdomdlg.cxx?r=ecf6f6f25663e81ebf18589b895a22bc5b6ffbab#143
Comment 8 Buovjaga 2025-02-12 16:04:22 UTC
(In reply to Balázs Varga (allotropia) from comment #7)
> > Aha. Well, this is a good example why bug report titles should not be copied
> > to commit messages.
> > 
> > Can you tell what we should do in the UI to see the toggle button currently?
> 
> Yeah, agree, it could be very confusing and misleading.
> 
> So two things need to be added:
> 
> First need to change the other password UI file: cui/ui/password.ui,
> basically the same as it was changed in the patch with the
> sfx2/uiconfig/ui/password.ui file. The password text fields need to be
> inserted in a horizontal two column gtk box. The first column of the gtk box
> contains the original password textfield and the second gtk column can
> contain the toggle button. Then need to add the "eye" image to the toggle
> button, as it was added in the patch with the sfx2/uiconfig/ui/password.ui.
> The images already added to our repo: see:
> icon-themes/colibre/res/showpass.png and
> icon-themes/colibre/res/hidepass.png files.
> 
> The second part is also basically the same what I did in the
> sfx2/source/dialog/passwd.cxx file in the patch, but for this specific issue
> need to be done in cui/source/dialogs/passwdomdlg.cxx
> 
> https://opengrok.libreoffice.org/xref/core/cui/source/dialogs/passwdomdlg.
> cxx?r=ecf6f6f25663e81ebf18589b895a22bc5b6ffbab#143

Thanks. I was wondering about the current situation, though, like how can we trigger your 6eb1a3c4b08f004c074dac41dee31bacb38216a5 in the UI?
Comment 9 Balázs Varga (allotropia) 2025-02-12 17:15:50 UTC
> Thanks. I was wondering about the current situation, though, like how can we
> trigger your 6eb1a3c4b08f004c074dac41dee31bacb38216a5 in the UI?

Ohh yeah, thats also important. :) So you can trigger it in two way:

1: Open writer app --> File --> Properties... --> Security (tab) --> Protect (button)

2: Open writer app --> File --> Export As --> Export As PDF... --> Security (tab) --> Set Passwords... (button)
Comment 10 Karthik 2025-03-09 08:24:01 UTC
The steps provided by "Balazs Varga" adds the toggle button to "Set Password" dialog while saving a file with password.
File -> Save-As -> Select "Save with password"

But, the original poster (Jeff Fortin Tam) wanted a toggle button to show/hide password when we open an encrypted file.
Comment 11 Buovjaga 2025-03-09 09:39:38 UTC
(In reply to Karthik from comment #10)
> The steps provided by "Balazs Varga" adds the toggle button to "Set
> Password" dialog while saving a file with password.
> File -> Save-As -> Select "Save with password"
> 
> But, the original poster (Jeff Fortin Tam) wanted a toggle button to
> show/hide password when we open an encrypted file.

Please try to find that dialog as well.
Comment 12 Karthik 2025-03-09 13:43:21 UTC
Implemented toggle button to show/hide password when we open an encrypted file

https://gerrit.libreoffice.org/c/core/+/182694
Comment 13 Commit Notification 2025-03-13 13:32:02 UTC
Karthik committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/1791a290a82591d5b0609502e86f07ed69acee5c

tdf#146947 Add show/reveal toggle to "Set Password" dialog

It will be available in 25.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 14 Commit Notification 2025-03-13 15:42:28 UTC
Karthik committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/bbd3f8063f496cfaf7a97cd8e1e2c6e118e611d9

tdf#146947 Add show/reveal toggle to "Enter Password" dialog

It will be available in 25.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.