“There is nothing more important than my rock-solid conviction that the person I choose could literally get up one day and be the president of the United States,” Mrs. Clinton said.

She made those comments as the Republican National Convention entered its first evening in Cleveland. A parade of speakers, including former Mayor Rudolph W. Giuliani of New York and retired Lt. Gen. Michael Flynn, spoke about the need to be tough in the fight against terrorism as they attacked Mrs. Clinton’s record.

The terrorist attack in Nice, France, the mass shooting in Orlando and the recent killings of police officers and police shootings of black men have all added to voters’ sense of insecurity this summer, with both candidates seeking to present themselves as the solution.

Voters are evenly split on whether Mrs. Clinton or Mr. Trump would better handle terrorism and national security, according to the latest New York Times/CBS News poll, a change from last month, when Mrs. Clinton had a seven-percentage-point advantage on the issue.

Mr. Trump’s choice for running mate, Gov. Mike Pence of Indiana, a social conservative not known for foreign policy experience, supported the war in Iraq and praised Mrs. Clinton’s handling of a NATO-led coalition to oust Col. Muammar el-Qaddafi in Libya — both of which Mr. Trump has criticized.

Other presidential candidates have used a running mate to bolster their appeal on foreign policy. In 1980, Ronald Reagan chose George Bush, whose résumé included serving as the director of the Central Intelligence Agency and the top American diplomat in China. In 2000, George W. Bush picked Dick Cheney, an experienced Washington hand and former secretary of defense.

Eight years ago, as she competed against Barack Obama in the Democratic primary, Mrs. Clinton’s campaign seized on national security to portray Mr. Obama as an inexperienced and dangerous choice. It ran one of the starkest ads of that cycle, in which a phone rings at the White House at 3 a.m. as the narrator asks, “Who do you want answering the phone?” Mrs. Clinton, wearing glasses, picked up the receiver.