Both candidates spoke via satellite to a gathering of the AARP, the nation's largest group of older Americans.
Obama said McCain's campaign has suggested trimming Social Security benefits, raising the eligibility age and privatizing a portion of the program.
"Privatizing Social Security was a bad idea when George Bush proposed it, and it's a bad idea today," Obama said.
He also said that McCain has called the way Social Security works "an absolute disgrace." McCain has said he meant that it was disgraceful that young workers might eventually receive fewer benefits than current retirees.
McCain said repeatedly that he did not favor privatization of Social Security.
"I'm committed to protecting and preserving Social Security," he said. "I will protect and preserve it. I won't hand it off to an unluckier generation - a system that is broken."
He said that in seeking a solution, he would be guided by some basic principles: not to raise taxes and to insure that retirees and workers close to retirement would not be affected by any changes. "There may be a role for private investment accounts for younger workers as long as they are not a substitute for insuring the solvency of the system and does not affect the system," McCain said.
McCain said he would bring Democrats and Republicans together to find an answer, much like President Ronald Reagan and the late House Speaker Thomas O'Neill did in the early 1980s with a commission that strengthened Social Security's solvency for many years. He referred to Reagan as a liberal but quickly corrected himself to say conservative.
"Every day we delay the more radical the fix has to be," McCain said.
Asked how he would save Social Security, protect workers' pensions and at the same time help Americans save, McCain audibly sighed and said, "It's a very tough problem."
All workers pay Social Security payroll taxes on the first $102,000 of their annual income. The money pays for benefits for current retirees and for other government programs. Analysts say the program will begin running short of funds in a few decades if it is not changed.
Obama cited his proposals to place a new Social Security payroll tax on incomes above $250,000 and to eliminate federal income taxes for older people making less than $50,000 a year. He also said he would "allow the government to negotiate with drug companies to lower costs for seniors, and we'll allow reimportation of drugs from other countries and ensure their safety."
The Wall Street Journal reported in March that McCain's top aides were "considering cost-of-living adjustment cuts and raising the retirement age as part of their Social Security plan." McCain has not endorsed or rejected those ideas.
The AP's White House Correspondent Terence Hunt reported from Colorado Springs, Colo.
By Associated Press Writers Charles Babington and Terence Hunt