I have an outlook VBA script which needs to connect to an remote server. For this the user must enter his server-password. To avoid hitting this server-password every time I wand to securely save it in the registry.
I already found an article how to encrypt a string: Can I use DPAPI (or something like it) in VBA?
But you need a secretkey for the encryption. Is there something userspecific in windows that I can use? I doubt that I can read the windows-password of the logged-in user because this would be a security gap. But is it possible to get the hash of his windows-password? In this case I could encrypt the server-password with the hash of the windows-password and fulfill both requirements. No one other then the logged-in user can get the server-password and the user itself do not need to type it in every time.
If there is no possibility to get the hash of the windows-password maybe there is some other userspecific information in window which only the logged-in user can access.
Regards,