From the course: iOS Development: Security
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Prevent pasteboard leakage with coding - iOS Tutorial
From the course: iOS Development: Security
Prevent pasteboard leakage with coding
- [Instructor] One way to avoid data leakage is to wipe out the contents of pasteboard when the app is about to move into the background. This transition occurs when we hit the home button while the app is running, or when we switch apps by double tapping the home button. But first, let me undo the secured text entry setting. This will re-enable the copying of text from the text field. Next, I switch to the AppDelegate. The AppDelegate application will resign active method is invoked before the app switches to the inactive state. So here's where we should clear the pasteboard. Let me scroll up a bit. We can erase our pasteboard data by setting its items property to an array that contains an empty dictionary. So UIpasteboard.general.items equals an array of empty dictionaries. The key should be a string, and the value can be any. I leave a breakpoint here to see when the execution gets here. Now let's begin the run. I'm going to type the password here. Select all. And copy is…
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
-
-
-
-
Purpose strings2m 7s
-
Request authorization for system features4m 7s
-
Adding the missing purpose string1m 34s
-
Exposing sensitive data through copying and pasting2m 16s
-
The pasteboard spy app2m 24s
-
Prevent pasteboard leakage without coding1m 11s
-
Prevent pasteboard leakage with coding2m 11s
-
Using an app-specific pasteboard5m 33s
-
Data leakage through app screenshots2m 16s
-
Clearing data before moving to the background3m 7s
-
Obscuring the snapshot before moving to the background3m 30s
-
Hacking the UserDefaults4m 40s
-
-
-
-
-
-