If you encrypt your password your curl script will have to decrypt it to use it as the password for your PHP task.
To encrypt your password you will have to use an encryption key, also known as a password. You will need the decryption key stored so your curl script can decrypt the password used for your PHP, but now you've stored the password for decrypting the password.
This is the problem that that all DRM (DVD encryption for example) runs into -- you have to make the keys available to decrypt what you're trying to protect, and you therefore compromise security.
Your best bet to be secure is to have a driver "program" (could be a script or whatever) that interactively asks for a password and hangs onto it until it's time to run the real job (your curl script in this case) at which time the driver can supply the password.
Alternatives to be completely non-interactive are to keep the password like you are now, but maybe in a less available space than the source itself, or to use certificate authentication to negotiate a secure and trusted connection - which of course involves getting certificates from a Certificate Authority.
Security is Not Easy.
And I second the answer mentioned by Teofilo Israel Vizcaino Rodrig in the comments.