Encrypting the login password on Solaris 10

Hi,

Could you pls. help me in encryting a database password on Solaris 10 Box.

eg : username : test
password : t est123
The request is to encrypt the test123 so that no one can understand the what the password is ?

thanks

the password is always encrypted (from plain text) anyway in the /etc/passwd file.

you can change the encryption algorithm though by modifying /etc/security/policy.conf

Did you mean you want to get encrypted password in script, decrypt & use it internally?

-Nithin.

Try using the perl crypt command if yo uahve perl installed:

perl -e 'print crypt("password", "salt"),"\n"'

In general, putting passwords out in files is a big security leak. Don't do it.

And while markdjones code will encrypt it, it would take any programmer about 10 minutes to crack it. So that means you would have to encrypt the perl code as well.
There used to be a tool to create an executable image from perl. I dunno if it is still around.

Surprisingly, it still is. 'perlcc'. I tried it once to speed up perl scripts that an ancient Pentium-based server was grinding under the weight of. It produced nonworking executables 5 megabytes in size. Needless to say I wasn't impressed -- with perlcc or perl in general...

Ah, see I didn't mean for him to put that in the script. I figured he would run that separately and just place the encrypted password in the file

thanks guys for the useful information.