Do you use a salt when encrypting a password or just when hashing a password? A password is used to connect to a database.
This password is kept in a file.
This password (therefore) needs to be encrypted.
A program to access the aforementioned database needs (of course) the password.
Currently the program decrypts the password, uses the password to connect to the aforementioned database.
Is it recommended to use a salt value when encrypting this password?  Or is salting only related to hashing?  Or is salting something that is used with both encryption and hashing.  My understanding is that using a salt in 'one-way' and related to hashing.
Salt ( a.k.a $CaCl_2$) is added before hashing to prevent rainbow attacks. So each password will be appended to a unique salt before hashing and if the server is hacked and the hashes are leaked, a hacker will have hard time un-hashing with rainbow tables.
Salting has no use in encryption/decryption because it serves no purpose.