Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you copy something else to the clipboard afterwards does it know not to clear it?


I wrote a CLI password manager as a personal project a few years ago and it would only clear the clipboard if the hash of the contents matched the hash of what was originally copied. I presume `pass` does something similar.


Hash? Why would you do any hashing? The domain is only so large so it's meaningless even if you cared about keeping the original bytes in RAM (which you don't).

This is the same concept behind the fact that it typically makes little to no sense to hash phone numbers or credit card numbers.


The way my clipboard-clearer worked would have exposed* the plaintext secret if it wasn't hashed. Surely this would be generally true; however, in my case, it would have been particularly trivial to exfiltrate.

(* The clipboard exposure was more limited...although probably only in a "security by obscurity" sense :P)


It makes sense if your password is something like hc0z3kjwedngwh4hgwct0-hunter2.


I don't think it does, it looks like it clears the clipboard and then restores the previous clipboard item. Your suggestion seems better.

https://git.zx2c4.com/password-store/tree/src/password-store...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: