moved encryption to test