Add extended encryption and decryption functiosn with unit test