As an alternative to a username/password, you could create a keypair and use something like scp instead of FTP, and only grant access to the private key file to users who are supposed to put files using this program. No password, and you're moving your access control/security problem out to the file system, rather than creating a new security problem. And if you need to replace the key because it has been compromised, you can do it without changing the code.