Add function exists checks to encrypt_secret and decrypt_secret