Encryption functionality mostly complete