Secure string comparison model function