bug fix in encrypt / decrypt