Add encrypt/decryptScopedKeys methods to server lib, tests pass