On your iPhone, iPad, or iPod touch

When asked if you want to use your device passcode as the iCloud Security Code, tap Create Different Code.

Tap Advanced Options, then choose one of these options:

Get a Random Security Code.

Don't Create Security Code. If you don’t create an iCloud Security Code, then your iCloud Keychain is stored locally on your device instead of Apple's servers, and will update only across your approved devices.

Follow the onscreen instructions to complete iCloud Keychain setup.

On your Mac using OS X Mavericks v10.9 or later

Choose Apple () menu > System Preferences.

Click iCloud, then select Keychain.

Enter your Apple ID password.

Click Advanced, then choose one of these two options:

Get a Random Security Code.

Don't Create Security Code. If you don't create an iCloud Security Code, then your iCloud Keychain is stored locally on your Mac instead of Apple's servers, and will update only across your approved devices.