Egypt is far safer than you may think. Indeed, it's a sad irony that the handful of terrorist attacks involving foreigners has given Egypt a reputation as a dangerous place, because it's blissfully free of the sort of ordinary social violence—murder, mugging, vandalism, and so on—that's all too common in the West. In Cairo there are no "bad" neighborhoods, only poor ones, and you can freely walk anywhere at any hour.
Pickpocketing is a minor concern in heavily touristed areas like bazaars. ATMs are safe to use at virtually any hour of the day or night, as many banks have 24-hour guards posted. Women can reduce unwanted advances by dressing in a way that reveals little skin. Generally, you'll find that you are more likely to be assaulted by hospitality than by violence.
What Egypt does have, unfortunately, are rare but shocking attacks that seek to destabilize the government by scaring away tourists (tourism revenue is the lifeblood of the country). The government stepped up security following the Luxor massacre in November 1997—which was likely the last gasp of the Islamist groups rather than a sign of their resurgence—but it is impossible to stop every radical, so the threat of attacks remains. Once you land in Egypt, however, you'll realize how remote this threat feels.
Although most people in Egypt will treat you with genuine kindness and honesty, there are exceptions. Watch out for the mostly harmless but annoying offers to "take you to my uncle's shop." This proposition is invariably offered by an unofficial guide who gets a percentage from the shop owner on any purchase you make. More serious are the rare instances of scams pulled by rogue "cops." These are usually police impersonators who will ask to see your passport and/or wallet, then will make off with whatever you give them. Do not turn over your passport to any unidentified person claiming to be a police officer, and certainly do not get into any unmarked "police" car.
It's perfectly safe for female travelers to brave Egypt alone, but women should expect to encounter a fair degree of unwanted attention from men, ranging from polite questions about marital status to catcalls in the street. The latter are best ignored, or perhaps answered with a sharp 'ayb (for shame!). For more-persistent admirers, just mention the tourist police, or the shurtat al-siyaha—you'll be surprised how quickly your unwanted companion will disappear. To put a stop to personal questions, politely point out to your interrogator that such questions are considered rude in your country; this will immediately embarrass him into silence. You can avoid unwanted attention by dressing modestly and being firm but polite when being approached by strangers. If you do ever feel threatened in public, or have the unfortunate experience of being touched inappropriately, raise your voice in any language and make a scene. You'll find Egyptians, both men and women, rushing to your defense. They'll deal with your aggressor swiftly and harshly.