iCloud Keychain stores website usernames, passwords, credit card numbers, and expiration dates you save with iCloud and keeps them up to date across all your iOS 7 or later devices and your Macs running OS X Mavericks (10.9) or later that you have approved.
When you turn on iCloud Keychain, the Safari AutoFill feature will prompt you to save your username, password or credit card information when you enter it. Once saved, the username, password or credit card information will auto fill so that you do not have to type it in again. Safari Autofill and iCloud Keychain will not store your credit card security code. For example, when making a purchase in Safari, select the credit card you want to use and Safari will automatically fill out the credit card number and expiration date. You will still need to type in your security code to complete the purchase. Safari’s new Password Generator can also suggest unique, hard-to-guess passwords for your online accounts and use iCloud Keychain to store these passwords. If you restore your device from a backup, iCloud Keychain can automatically sign in to your saved accounts.
Your iCloud Keychain is encrypted when transmitted to your devices and when stored in iCloud, and cannot be read by Apple.
You can set up your iCloud Keychain on a second device by authorizing that device from your original device, allowing you to keep your iCloud Keychain up to date just across the devices you have approved. You can also set up a four-digit, complex, or random Security Code to sync your passwords to a new device. You should write down your Security Code, and keep it in a safe place. Apple cannot replace a lost Security Code.