Post

Replies

Boosts

Views

Activity

Reply to Encrypted backup
I think I've got the logic of it now. Because I'm a bit slow, could you please correct me if I have this wrong.1. A key is derived from a password.2. It's used to encrypt the textfile.3. It can then be gotten rid of, because when it comes to decryption the same key will be derived from password input again and used to decrypt the file?
May ’20
Reply to Encrypted backup
Thanks heaps. I have it running nicely in the playground. I spent quite a bit of time going down a few deadends trying to work out how to save it, until I cottoned on to saving it as Data. I hope you don't mind if I ask a few more questions.I've saved it this way:let filename = getDocumentsDirectory().appendingPathComponent("backup.txt")//Write to filedo { let e = Data(encryptedData.combined!) try e.write(to: filename)Is saving it to a standard .txt file okay?Also, for arguments sake, if the salt and rounds needed to be hidden, how would that be handled? I don't know anything about what happens when an app is installed, but I imagine the salt and rounds could be stored in a file and then, during installation, written to the keychain while the file is deleted, or would that be insecure? I guess that any values that required high security could be encrypted and then unencrypted during the installation process for passing into the keychain.Sorry for so many questions, but I have one more. I know that the iPhone is encrypted as a whole, but if I wanted to have encryption on top of that, within my app, is cryptokit suitable for implementing that, or would common crypto be the better option?
Jun ’20
Reply to Encrypted backup
Cheers. It's a poor choice, but I have no idea what would be the right choice. If it was an image then it's jpeg, or png, or something obvious, but with lots of googling and time I still haven't tracked down what an encrypted data file ought to be.
Jun ’20
Reply to openUrlContexts issue
I'm still struggling with this. I've read the UIScene documentation but still cannot see where I am going wrong. As I said, my file opens the app, it just doesn't call the openURLContexts function. As I understand it, iOS should automatically pass information about the file that opened the app to the ScenesDelegate, which would include the url to the file. Or do I have that wrong? The line of code that I mentioned above, that I placed in the willConnectTo method only calls the openURLContexts method when the app is initially launched, not when it is launched from a saved file. Any help will be much appreciated.
Jun ’20
Reply to openUrlContexts issue
Thank you. That one did slip by me. I’ve been doing a lot of experimenting in practice projects and the method is being called now without having to manually call it. I’m not sure what the initial problem was, but I suspect a setting in the info.plist. If the app is set to not run in the background the app Will start from an exported file, but openURL does not get called.
Jun ’20
Reply to Trouble accessing fileURL: Simulator to iPhone
Hi eskimo, I've discovered my error. I set "open document in place" to NO, and it now imports and processes without a problem. I was using the guard statement below, and when it wasn't working I tried the do statement, which didn't work either. I haven't tried the guard statement yet to see if it works since changing the setting, but I suspect that it will. I don't know why it wasn't working. I guess it has something to do with the url having private in its path. I've got some learning to do there. "Failed reading from URL: file:///private/var/mobile/Containers/Shared/AppGroup/FC9D99" var data = Data()   do {    data = try Data(contentsOf: url)   }catch let error as NSError{    print("Failed reading from URL: \(url), Error: " + error.localizedDescription)   }           //guard let data = try? Data(contentsOf: url) else { return "blah" }
Jul ’20
Reply to Why XCode 12.1 download takes so long?
Every time I download from apple servers it takes forever. Xcode literally always takes me hours to download and install. It's never a joy, especially this time when Xcode 12.1 isn't running very well. It's slowing down my computer, crashing Spotlight, and not starting up my app properly. It ran like a dream prior to updating.
Oct ’20
Reply to Programmatically closing an app.
Thanks, Claude31 I was wondering the same thing about exit(0). Quite a few people say that would be rejected, but then I see others who have had no issue with it. I have an app on my phone where I think the developer has exit(0) in the cancel button. It certainly looks like it when I press the cancel button.
Jan ’21