formatted encryption and decryption