More work on encryption code