My program asks a user to create a 4-digit passcode (much like the unlock screen built into the iPhone). The program will store the passcode and test it against a passcode entered at a later date and will deny or give access to a tableview of documents. I also need to store the passcode in iCloud incase another device wants to use the same database of documents. I do not need to store username information.
I've been reading about using keychain but this seems like a bit of overkill for my purpose. I'm a beginner to security and have no clue on what to do and what NOT to do. Can anyone point me in the right direction for what documents or tutorials I could read that would be appropriate for my application? Thanks for the help.
UPDATE
note about using keychain in reply to the answers below:
If I was to use keychain I'm under the impression from the apple docs that I would not be able to nor should I store the passcode on iCloud. This presents an interesting problem because storing documents on iCloud is an essential behavior of my application as users need to access the same set of documents which are protected by a passcode across multiple devices. How do I approach this problem? Is there a known secure way to work around this or would I have to totally abandon the use of keychain all-together?