     }
     
     func randomDataWithLength(inLength : size_t) -> NSMutableData {
-        let theData = NSMutableData(length: inLength)
-        SecRandomCopyBytes(kSecRandomDefault, inLength, UnsafeMutablePointer<UInt8>(theData!.mutableBytes))
-        return theData!
+        guard let theData = NSMutableData(length: inLength) else { fatalError() }
+        SecRandomCopyBytes(kSecRandomDefault, inLength, UnsafeMutablePointer<UInt8>(theData.mutableBytes))
+        return theData
     }
     
     func keyFromPassword(inPassword : NSString, inSalt : NSData) -> NSData {

        var outLength : Int = 0
        let theIV = inData.subdataWithRange(NSMakeRange(inData.length-kCCBlockSizeAES128, kCCBlockSizeAES128))
        let theCipherText = inData.subdataWithRange(NSMakeRange(0, inData.length-kCCBlockSizeAES128))
        let theClearText = NSMutableData(length: inData.length + kCCBlockSizeAES128)
        let theOperation : CCOperation = UInt32(kCCDecrypt)
        let theAlgorithm :  CCAlgorithm = UInt32(kCCAlgorithmAES128)
        let theOptions :   CCOptions = UInt32(kCCOptionPKCS7Padding)

        let theFileManager = NSFileManager.defaultManager()
        let theLocalDirectories = theFileManager.URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask)
        
        guard let theDocumentsPath = theLocalDirectories.first else { fatalError() }
        let theFileURL = theDocumentsPath.URLByAppendingPathComponent("foobar.txt")
        
        let theContentString = "foobar"
        let theContentData = theContentString.dataUsingEncoding(NSUTF8StringEncoding)
        
        let theAttributes = [NSFileProtectionKey : NSFileProtectionComplete]
        guard let theFilePath = theFileURL.path else { fatalError() }
        theFileManager.createFileAtPath(theFilePath, contents:theContentData, attributes:theAttributes)
        
        // Backup exclusion
        do {
            try theFileURL.setResourceValue(true, forKey: NSURLIsExcludedFromBackupKey)
        } catch {
            print("Error: \(error)")
            print("Backup exclusion not set")
        }
        
