added encrypt/decrypt to controller