Encrypt and lock the application on exit

This is basically a duplicate of Local encryption.