Recent documentation on securely storing password in Windows registry?

glassesdumpbreathe 0 Reputation points
2024-09-24T15:09:42.6033333+00:00

I am trying to find recent, trustworthy, step-by-step documentation on how to securely store passwords (for example, an Oracle database password) in a Windows registry. I am using Windows 11.

My end goal is to write a Python script that queries an Oracle database table. I understand that it is not best practice to write passwords in plain text in a script, so I was advised to write a Python script that will obtain the Oracle database password from the Windows registry.

I am having trouble on finding trustworthy, recent step-by-step documentation on securely storing a password in the Windows registry. I did find this Learn Article Opening, Creating and Closing Keys. However, what I'm seeking are trustworthy step-by-step instructions on securely adding a password to the registry.

I did find Registry Editor on my computer, which appears to let me use it's GUI to add a key and a value. However, I'm not certain if this is secure, or if there is something else I need to do rather than just adding the password as a value.

I am trying to find recent, trustworthy, step-by-step documentation on how to securely store passwords in a Windows registry.

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,628 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
9,694 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Castorix31 85,371 Reputation points
    2024-09-24T17:08:51.4366667+00:00

    One of the ways is with CredWrite/CredRead(store the password in CREDENTIAL.CredentialBlob/CREDENTIAL.CredentialBlobSize with a given CREDENTIAL.TargetName)

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.