Does erase all content and settings securley wipe?

I want to sell my iphone 4 to a friend of mine. I used to have some business info on the phone but i deleted it. I know deleting stuff doesn't "really" delete stuff and while i trust my friend i worry if somebody would steal the phone from my friend they could recover the deleted data. I've heard erase content and settings deletes the encryption key making old data unrecoverable but i don't know if its true. What's the correct way to securely sanitize my iphone before sale.

The Erase All Content and Settings option built into the iPhone 4 is definitely a secure erase method, so there's nothing you need to worry about.

The original iPhone did not securely erase user data at all, prompting Apple to change this behavior in iOS 2.0 to actually do a bit-by-bit wipe of the flash memory-a process that took anywhere from 1-3 hours, depending on the capacity of your device.

However, with the iPhone 3GS and iOS 3.0, Apple introduced hardware-level encryption expressly for the purpose of facilitating a fast, secure wipe process. This was likely inspired by the advent of the "Remote Wipe" feature introduced with Find My iPhone at the same time; it only made sense that if you lost your device, you wanted to be able to ensure that it was securely wiped quickly to prevent the process from being interrupted once it began.