Hey there,
can't be too specific because I'm not sure exactly what you're trying to do or what your code looks like.
If you want to read the program into a file
cat program >file
if you want to read a file into the program
program <file
to encrypt data use either regular passwd, htpasswd or openssl
Tracking user usage would require parsing a usage file or keeping track of live statistics. I can't be any more specific than that with the info you've given.
Best of luck
, Mike