Let us assume you have to set password for user, and this password should be stored in f.e. git.
The way how password actually stored in Linux helps with this task a lot.
I mean /etc/shadow file.
The only this you have to do is to generate such a string for you and update it with sed
F.e. with a script like this