Encrypt passwords in config.properties file
<p>I am running a bunch of shell scripts which uses the properties in config.properties file.. it has database connection details, passwords.. etc., 
I just want to encrypt the passwords.. so that when someone looks at the properties file they shouldn't be able to use it. 
Also I don't want to change the permissions on the file, I want only the passwords to be encrypted</p>

<p>I know there are few ways.. like using java or using any encryption algorithm but I don't want to use java.</p>

<p>I am running the shell scripts on CentOS.. sample scripts looks like below..</p>

<h2>config.properties</h2>

<pre><code>    DatabaseHostName=test_host
    DatabasePort=4898
    DatabaseUserName=test_user
    # MY DB Password here is visible.. I want to encrypt this
    DatabasePassword=password123
</code></pre>

<h2>script.sh</h2>

<pre><code>    #sourcing the above properties file here
    source ./config.properties
    export PGPASSWORD=${DatabasePassword}
    psql -h ${DatabaseHostName} -p ${DatabasePort} ${DatabaseUserName} -c "select * from table_name;"
</code></pre>

<p>my both files are under the same folder</p>