encrypt_digest function prototype modified as there was a redundant parameter