Ensure correct keys are encrypted