separated encrypt and decrypt function into files.