As with all of Latin America, Ecuador has certain security issues. Although theft and attacks are quite common, it's easy to avoid getting into trouble if you remain prudent.
Ecuador is a poor country As is often the case in South American countries, security can be an issue. There's no need to be paranoid - just be street-wise. This is particularly important in the larger towns. Theft and assaults are a problem in Quito, even more so in Guayaquil. Same goes for the mountainous region in the north. Attacks have been reported on some hiking trails. And, as if often the case, tourists are the target.
Although pickpockets are generally non-violent, they're good at their job and tend to work the capital's public transport system.
Another important issue - drugs. Foreigners held in Ecuador's prison are there for one reason, namely drug-related charges. Trust me, being faced with a ten-year prison sentence is one way to ruin your holiday.
Rest assured that the historic centre of Quito is safe during the day. At nightfall, however, it's a different matter and the same goes for the rest of town. Use taxis to get around. Only use official taxis so as to ensure your safety.
You need to be even more careful in Guayaquil. This town is, without a doubt, the most dangerous in the country. Before heading out on foot, check out the situation in the neighbourhoods you plan to cross beforehand. Don't show any signs of wealth or indications that you're a tourist. If you get lost, go to the nearest shop and ask if they can order you a taxi.
If you're going on a hike, particularly in the Quilotoa region, tell your hotel which trail you're planning to follow and check out security conditions before you start. Attacks have been reported. The other danger in this area is sudden weather changes. If you have any doubts, hire a guide.
If you do get attacked, try to stay calm and don't resist. Don't keep all your money in one place - keep a small sum in an easily found pocket, in the hope that it will appease any thief. Ten or so Dollars will usually satisfy a junkie in search of a hit and they will probably run off without demanding more. If you follow these basic rules and remain sensible, then there's no reason why you should have any trouble during a trip to Ecuador.