encrypt in input and output