Here's what I would do if I was going to sell an iPhone I had owned:
1. Restore as new.
1. Jailbreak the device.
2. Find a zero out utility (like this one: http://totalsmartphone.net/2010/03/iwipe-cleanse-iphone-user-partition-iwipe-iphone-jailbreak/) in Cydia to zero out the user partition of the device.
3. Restore again (probably in DFU mode).
4. Maybe re-jailbreak if you think you can add it as a "feature" to the sale, but I never get that since it seems as though it wouldn't do the buyer any good the first time they decide to sync with their machine.
It's a bit paranoid, but it's pretty secure. In theory someone could jailbreak a purchased iPhone, SSH in and use a utility to look for undeleted personal data that hadn't been zeroed out.
Wirelessly posted (Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0_1 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A306 Safari/6531.22.7)
DiamondGCoupe said:
Just be careful, a lot of people have sold their phones only to have the buyer state the box was empty and PayPal refunded the money.