Menu

#2913 Add "Copy Last X Digits" right click option

KeePass_2.x
open
nobody
None
5
2025-02-02
2025-01-31
lwc
No

When contacting services over chat or phone, many of them ask for the last X digits in your credit card.
Likewise for logins in credit card sites.
Usually they ask for 4 digits, but some even ask for 6.

Without this option, it means one has to manually expose the password and copy those digits, and that also means not protecting it from the clipboard.

I think there should be a quick option to securely copy at least see those last X digits.

1 Attachments

Discussion

  • wellread1

    wellread1 - 2025-01-31

    Something similar is already possible.

    Make a dedicated string field(s) that contain the last n characters of the full string. Then use the entry's context menu [Other Data>*string field name* or the KeePass menu item Entry>Other Data>*string field name* to copy and paste the string field containing the n digits.

    If you install the KPEnhancedEntryView plugin it is possible to auto-type string field values directly from the KeePass Entry View pane.

     
    • lwc

      lwc - 2025-01-31

      Thanks! That's true, it is copyable this way, but:

      1. It means saving the very same password twice (and remembering to change it twice if needed later on) + the short version will be easier to crack and make the longer version less safe since the last X digits will be known if the easier version got hacked.
      2. It takes longer since it's 3 steps instead of 2 (right click/menu => Other Data => Field name) and thus always easier to mistake, while in chat or phone time is of the essence and any mistake can disconnect the chat/phone right away.
      3. Even if I enable Process Memory Protection is it just as safe as storing passwords?
      4. Regarding the extension, since last X digits are used mostly for chat or phone, quick reveal or copy is what's needed here, not AutoType.
       
  • wellread1

    wellread1 - 2025-02-01
    • (1) Use the {T-REPLACE-RX:/Text/Search/Replace/} placeholder to extract the needed subsisting into a second string field or use in a auto-type keystroke sequence, e.g.,
      {T-REPLACE-RX:!{S:Credit Card}!.*(\d{4})$!$1!}
      would extract the last 4 digits of a credit card number from a string field called Credit Card. (Also works on the built-in string fields)
    • (3). Yes, enabling Process Memory Protection on individual string fields is just as safe enabling it for the built-in password field.
    • (2 & 4) Use copy, or the KPEnhancedEntryView plugin, or use more steps.
     

    Last edit: wellread1 2025-02-01
    • lwc

      lwc - 2025-02-01

      {T-REPLACE-RX:!{PASSWORD}!.*(\d{4})$!$1!} indeed works both in Notes and in String fields, thanks!!!

      Still if you have 5 cards and you want both 4 and 6 digits, that means creating 10 Sting fields.
      My proposal is to have it built-in since it's used a lot.

       
      • wellread1

        wellread1 - 2025-02-01

        How many Credit Cards do you have?

        You are considering just two particular cases where a user might want to parse a string field value in a particular way when in fact, there are a multitude of different ways a user might want to parse these values. Trying to accommodate everyone's particular needs would produce an unwieldy list. The KeePass T-REPLACE-RX placeholder provides a general way to address these parsing issues on a case by case basis. There are also ways to improve the workflow mentioned above.

         
  • Paul

    Paul - 2025-02-02

    You could use the {PICKCHARS} placeholder to make it an Auto-Type. Then you can choose as many characters as you need.

    cheers, Paul

     
    • lwc

      lwc - 2025-02-02

      Nice, I can use it in a String field like {PICKCHARS:Password} or {PICKCHARS:Password:C=4}. But it's easy to get confused while I'm a chat/phone and any mistake will cause a disconnect. Wish I could tell it to limit to last 6 digits and then let me choose in real time 4 or 6. Otherwise I'd stick with the {T-REPLACE-RX} solution for now.

       

Log in to post a comment.

MongoDB Logo MongoDB