I'm developing a kind-of secure password manager. It won't be for professional use, and I know it won't be as secure as KeePass or anything. This is just for my own understanding of how to allocate secure memory, using crypto-algorithms etc.
For this I work with libgcrypt and allocate my memory with gcry_malloc_secure
.
I've now come to a point where I somehow need the user to enter his password for encryption/decryption.
But as I see it, any console input is first buffered in stdin
(or argv[..]
) and thus not in secure memory. So it could "easily" be read by an attacker.
Any security-related thing that happens inside my program is in securemem and hopefully harder to read/steal.
So my question is like the title states:
What is the most secure way to let a user input data?