Refactor auth, move encrypt functions to __init__.py