in reply to Password encryption

See the FAQ How can I hide the source for my Perl program? for a discussion of the futility of using encryption in the source as a security measure. If your running script can decrypt the password so can anyone else who reads the source.

Since you are using SSH anyway you might consider using its built-in asymmetric key auth instead.