erogol
erogol

Reputation: 13604

How could I securely embed a required password into source code?

I am writing a Python code and it is requisite to include a password of one of my online account. I want to cover it in some way as keeping its functionality in the code. Is there nay way to masquerade this kind of credential information as keeping its use in the source code?

Upvotes: 0

Views: 427

Answers (2)

smeso
smeso

Reputation: 4295

You should tell us what kind of protection you want. Do you want to make everybody able to execute you script without knowing the password? Do you want to be the only able to execute you script but you want to protect the password from people who can read the source? There may be different solution.

However every solution will require you to insert another password to get access to the stored password. So I think that the best solution would be not to save the password in the source at all.

Upvotes: 0

Saran Makam
Saran Makam

Reputation: 126

I would recommend two levels to secure passwords. 1 encrypt, 2, protect the key used for encrypting in key store.

Details- Encrypt the password using aes 256 or similar based on the risk. Key used for encrypting should be in key store and you can hard code the key store password.

You can also choose number of levels based on risk, usually at least two is recommended.

Upvotes: 1

Related Questions