Candidates pledge to safeguard nation's security