Added new functions for encryption