To get a script out of ALM you will need to authenticate.. there's one layer of 'password protection'.
To make it slightly harder to change a script, and see who changed things (what and when) and be able to roll back, you'd need to turn on Version Control.
For standalone scripts you'd have to try and integrate with a version control tool, which I haven't tried with QTP/UFT.
Is there a way to password protect UFT scripts and libraries in stand alone scripts and/or in ALM?
Are you trying to password protect the script? or trying to hide sensitive data used by your automation scripts?
If you are trying to do the latter, I'd recommend storing the password inside environment variables. Here's how this works..
1) For logins and sensitive data, have your automation read the data form an environment variable in your framework/setup.
2) In a separate password protected repo. Create a *.bat file that sets the environment variables with the sensitive data. Put it in a separate repo with access rights.
3) When you run your tests, run the .bat file first to set the ENV vars, then run the test.
This has the following benefits..
* It separates the credentialing and the test creation, so devs can run tests on their local builds without knowing sensitive credentials, while you can run your tests on staging or production using sensitive credentials only accessible by those with the correct rights.
* In a CI setup, you can have the CI pull the credential .bat file, run it, and immediately delete the .bat file from it's local hard drive. Then run the tests. This will ensure the credential only exists in memory, and say a malicious user will have a harder time sealing the credentials by hacking into a build machine. (the hacker would need to do a memory dump while the tests are running)
* It plays well into the 12 factor app concept. Tests can be reconfigured for their target environment very easily.