Need to encrypt mysql password stored in text file RRS feed

  • Question

  • Hi All,

    I have a batch script which connects to an Oracle database and executes sql scripts via the sqlplus command. It works fine, however the connection details are in plain text which isn't ideal for security; but getting the connection working was the main thing first.

    Now that I've moved onto the security side of the script, I have created a setup where a txt file exists and contains the username/password for the database. The main batch script reads in the username/password into 2 variables and these variables are what's used in the connection string of the main batch script. So the connection details are never seen in plain text in the main batch script, they are only seen in the txt file which it reads from.

    My issue is I want to encrypt this text file which contains the username/password, so only selected users can access it. Is there a way I can encrypt the username/password file (without a 3rd party software if at all possible) and still have the main batch script call it and read the username/password into the 2 variables as explained above? So the only way the username/password file is ever seen in plain text is if it is decrypted with the key/passphrase by selected users on my team.

    Any help would be greatly appreciated and please find example snippets below. I am on a Windows 7 machine.

    • Moved by Bill_Stewart Wednesday, September 4, 2019 6:18 PM This is not "scripts on demand"
    Tuesday, March 5, 2019 11:12 AM

All replies

  • This can only be done in PowerShell.


    Tuesday, March 5, 2019 11:52 AM