From the course: iOS Development: Security
Unlock the full course today
Join today to access over 23,200 courses taught by industry experts.
Hacking the UserDefaults - iOS Tutorial
From the course: iOS Development: Security
Hacking the UserDefaults
- [Instructor] If you've developed iOS apps it's likely that you used UserDefaults for storing small pieces of data. Yet you shouldn't rely on UserDefaults to persist sensitive data, like login credentials. We'll see in a moment why. We use the Pasteboard Demo app from the previous lesson. If you want to follow along with me, open the project from the exercise files folder, chapter two 02_12 begin. Now let's add a feature of saving and restoring the username and the password. I switch to the main storyboard and I'll add a button. The title should be Save Credentials. Whenever the user taps the button, the contents of the username and password field should be persisted to UserDfaults. So I bring back the assistant editor and choose the ViewController source file. With the button selected in the storyboard view, I click the Connection inspector. We'll create an Action Handler by dragging from the Touch Up Inside event to the source file. Let's call the method onSaveCredentials. I…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Purpose strings2m 7s
-
(Locked)
Request authorization for system features4m 7s
-
(Locked)
Adding the missing purpose string1m 34s
-
Exposing sensitive data through copying and pasting2m 16s
-
(Locked)
The pasteboard spy app2m 24s
-
(Locked)
Prevent pasteboard leakage without coding1m 11s
-
(Locked)
Prevent pasteboard leakage with coding2m 11s
-
(Locked)
Using an app-specific pasteboard5m 33s
-
(Locked)
Data leakage through app screenshots2m 16s
-
(Locked)
Clearing data before moving to the background3m 7s
-
(Locked)
Obscuring the snapshot before moving to the background3m 30s
-
(Locked)
Hacking the UserDefaults4m 40s
-
(Locked)
-
-
-
-
-