Key derivation, logging, and encryption

Key derivation working
Need to implement path validation for logging
Finish up encryption