Sam is what I used and worked flawless but here are 2 methods.
Go to Cydia and add this source:
http://repo.binger.com if needed I think it's in other repos now.
Step 3: Install SAMPrefs from the above source
Step 4: After SAMPrefs is installed, an incon in Yellow will be visible on the Springboard saying SAMPrefs. Launch it.
Step 5: Now head over to utilities and de-activate the iPhone.
Step 6: After that, insert the desired SIM card on the remote factory unlocked iPhone.
Step 7: Once finished. Open iTunes to activate the device. Once activated, a message will arrive stating the iPhone has been unlocked. That’s it.
or option 2
Method 2: Use Redsn0w to Activate Your Unlocked iPhone 4, 4S, 5
Step 1: Download the latest redsn0w version.
Step 2: Connect the device to the computer and open the rednsn0w software.
Step 3: Click the ‘Jailbreak’ option. The iPhone is going to be connected in a ‘Normal’ state, but the device needs to be put in DFU mode.
Step 4: Now the build version of the phone will be detected by redsn0w.
Deactivate - Activate unlocked iPhone with redsn0w
Step 5: After the successful detection of the build, a few options will be presented to you by rednsn0w. Check ‘Deactivate’ and un-check all other options, including Cydia.
Step 6: After the completion of the deactivation, remove the SIM card and turn off the device.
Step 7: Now turn on the iPhone, connect it to iTunes, and insert the SIM card. If you did everything right, the unlock confirmation message will be displayed by iTunes.