SlideShare a Scribd company logo
1 of 32
Security and Encryption
   16ccf74271895e611555bf1f00047944
Security Requirements
Security Requirements

        Documents
        High Scores
        Multiplayer
           Chat
Security Requirements

        Documents
        High Scores
        Multiplayer
           Chat
Security Requirements
                 Content
                  State
                   Ads
Security Requirements
         *
Security Requirements
Security Requirements

• Ask the user (or client, product
  manager…)
Security Requirements

• Ask the user (or client, product
  manager…)
• But don’t expect them to know the
  answer!
Security Requirements

• Ask the user (or client, product
  manager…)
• But don’t expect them to know the
  answer!
    Confidentiality           Exposure
Security Requirements

• Ask the user (or client, product
  manager…)
• But don’t expect them to know the
  answer!
    Confidentiality           Exposure
      Integrity              Tampering
Security Requirements

• Ask the user (or client, product
  manager…)
• But don’t expect them to know the
  answer!
    Confidentiality           Exposure
      Integrity             Tampering
     Availability           Destruction
Security Requirements
 “In an incident that highlights the growing
 security challenges around wireless apps,
 Citi said its iPhone app accidentally saved
 personal account information in a hidden
file on users' iPhones. Information that may
  have been stored includes their account
numbers, bill payments and security access
                    codes.”
       http://www.nypost.com/p/news/business/citibank_admits_security_flaw_in_fDLT7l6VFdqKLLaTx75cYM
Don’t copy me, bro
iTunes ignores:
•Library/Caches
•tmp
not:
•Documents
•Library/Preferences
•Library/Application Support
Use Data Protection
Use Data Protection
Use Data Protection
Use Data Protection
Use Data Protection
[myData writeToURL: location
 options: NSDataWritingFileProtectionComplete
 error: &error];
Use Data Protection
[myData writeToURL: location
 options: NSDataWritingFileProtectionComplete
 error: &error];

                        NOT
[[NSFileManager defaultManager]
 setAttributes: [NSDictionary
            dictionaryWithObject:
               NSFileProtectionComplete
            forKey:
               NSFileProtectionKey]
 ofItemAtPath: [location path]
 error: &error];
Use Data Protection
[myData writeToURL: location
 options: NSDataWritingFileProtectionComplete
 error: &error];
Use the Keychain

• mostly just works…
• kSecReturnRef usually fails
• kSecMatchItemList succeeds wrongly(!)
• easiest to use attributes/persistent refs and
  kSecReturnData
Finding a Keychain Item
NSDictionary *foundAttributes = nil;

NSDictionary *searchAttributes = [NSDictionary dictionaryWithObjectsAndKeys:
                       [@"info.thaesofereode.samplepassword"
                        dataUsingEncoding: NSUTF8StringEncoding],
                       kSecAttrApplicationTag,
                       kCFBooleanTrue, kSecReturnAttributes,
                       nil];
OSStatus searchResult = SecItemCopyMatching(searchAttributes,
                              &foundAttributes);
if (noErr == searchResult) {
    // use the keychain item
                                                  Source: Professional Cocoa Application Security
Saving a Keychain Item
 attributesToStore = [searchAttributes mutableCopy];
 [attributesToStore setObject: self.userNameField.text
               forKey: kSecAttrAccount];
 [attributesToStore setObject: passwordData
               forKey: kSecValueData];
 [attributesToStore setObject: kSecClassInternetPassword
               forKey: kSecClass];
 [attributesToStore setObject: @"www.example.com"
               forKey: kSecAttrServer];
 [attributesToStore setObject: kCFBooleanTrue
               forKey: kSecReturnPersistentRef];
 [attributesToStore setObject: @"Sample password"
               forKey: kSecAttrDescription];
 [attributesToStore setObject: @"password label"
               forKey: kSecAttrLabel];
 [attributesToStore removeObjectForKey: kSecReturnAttributes];
 NSData *persistentRef = nil;
 OSStatus result = SecItemAdd(attributesToStore, &persistentRef);




                                       Source: Professional Cocoa Application Security
Encrypt Files Yourself


• CommonCrypto
• OpenSSL
Encrypt Files Yourself

• Choose appropriate algorithm, key size,
  mode
• Note the bootstrap problem
• Get randomness from
  SecRandomCopyBytes()
Encrypt Files Yourself
  size_t bytesNeeded = 0;
  CCCryptorStatus cryptResult = kCCSuccess;
  cryptResult = CCCrypt(kCCEncrypt,
                  kCCAlgorithmAES128,
                  kCCOptionPKCS7Padding,
                  [key bytes],
                  [key length],                                                kCCOptionPKCS7Padding,
                  [iv bytes],                                                  [key bytes],
                  [plainText bytes],                                           [key length],
                  [plainText length],                                          [iv bytes],
                  NULL,                                                        [plainText bytes],
                  0,                                                           [plainText length],
                  &bytesNeeded);                                               cipherBytes,
  if (kCCBufferTooSmall != cryptResult) {                                      bufferLength,
      *error = [NSError errorWithDomain:                                       &bytesNeeded);
GLFileEncryptorErrorDomain                                     if (kCCSuccess != cryptResult) {
                          code: GLFileEncryptorCryptFailed         *error = [NSError errorWithDomain:
                       userInfo: nil];                       GLFileEncryptorErrorDomain
      return nil;                                                                      code: GLFileEncryptorCryptFailed
  }                                                                                 userInfo: nil];
  char *cipherBytes = malloc(bytesNeeded);                         free(cipherBytes);
  size_t bufferLength = bytesNeeded;                               return nil;
  if (NULL == cipherBytes) {                                   }
      *error = [NSError errorWithDomain:
GLFileEncryptorErrorDomain
                          code: GLFileEncryptorOutOfMemory
                       userInfo: nil];
      return nil;
  }
  // now actually encrypt the file
  cryptResult = CCCrypt(kCCEncrypt,
                  kCCAlgorithmAES128,                                 Source: Professional Cocoa Application Security
Non-solutions


• Write your own encryption algorithm
• Wait until someone reports the problem
iamleeg
iamleeg

More Related Content

What's hot

Cryptography 101 for_java_developers, Fall 2019
Cryptography 101 for_java_developers, Fall 2019Cryptography 101 for_java_developers, Fall 2019
Cryptography 101 for_java_developers, Fall 2019Michel Schudel
 
Cryptography 101 for Java developers
Cryptography 101 for Java developersCryptography 101 for Java developers
Cryptography 101 for Java developersMichel Schudel
 
Toni de la Fuente - Automate or die! How to survive to an attack in the Cloud...
Toni de la Fuente - Automate or die! How to survive to an attack in the Cloud...Toni de la Fuente - Automate or die! How to survive to an attack in the Cloud...
Toni de la Fuente - Automate or die! How to survive to an attack in the Cloud...RootedCON
 
SSL/TLS for Mortals (J-Fall)
SSL/TLS for Mortals (J-Fall)SSL/TLS for Mortals (J-Fall)
SSL/TLS for Mortals (J-Fall)Maarten Mulders
 
SSL/TLS for Mortals (GOTO Berlin)
SSL/TLS for Mortals (GOTO Berlin)SSL/TLS for Mortals (GOTO Berlin)
SSL/TLS for Mortals (GOTO Berlin)Maarten Mulders
 
6.1. iCloud keychain and iOS 7 data protection
6.1. iCloud keychain and iOS 7 data protection6.1. iCloud keychain and iOS 7 data protection
6.1. iCloud keychain and iOS 7 data protectiondefconmoscow
 
JavaFest. Nanne Baars. Web application security for developers
JavaFest. Nanne Baars. Web application security for developersJavaFest. Nanne Baars. Web application security for developers
JavaFest. Nanne Baars. Web application security for developersFestGroup
 
[DefCon 2016] I got 99 Problems, but 
Little Snitch ain’t one!
[DefCon 2016] I got 99 Problems, but 
Little Snitch ain’t one![DefCon 2016] I got 99 Problems, but 
Little Snitch ain’t one!
[DefCon 2016] I got 99 Problems, but 
Little Snitch ain’t one!Synack
 
Active Directory Recon 101
Active Directory Recon 101Active Directory Recon 101
Active Directory Recon 101prashant3535
 
SSL/TLS for Mortals (Devoxx FR 2018)
SSL/TLS for Mortals (Devoxx FR 2018)SSL/TLS for Mortals (Devoxx FR 2018)
SSL/TLS for Mortals (Devoxx FR 2018)Maarten Mulders
 
Hacking intranet websites
Hacking intranet websitesHacking intranet websites
Hacking intranet websitesshehab najjar
 
OpenStack Folsom Summit: Melange overview
OpenStack Folsom Summit: Melange overviewOpenStack Folsom Summit: Melange overview
OpenStack Folsom Summit: Melange overviewtroytoman
 
iOS Automation Primitives
iOS Automation PrimitivesiOS Automation Primitives
iOS Automation PrimitivesSynack
 
SSL/TLS for Mortals (JavaZone)
SSL/TLS for Mortals (JavaZone)SSL/TLS for Mortals (JavaZone)
SSL/TLS for Mortals (JavaZone)Maarten Mulders
 
Yihan Lian & Zhibin Hu - Smarter Peach: Add Eyes to Peach Fuzzer [rooted2017]
Yihan Lian &  Zhibin Hu - Smarter Peach: Add Eyes to Peach Fuzzer [rooted2017]Yihan Lian &  Zhibin Hu - Smarter Peach: Add Eyes to Peach Fuzzer [rooted2017]
Yihan Lian & Zhibin Hu - Smarter Peach: Add Eyes to Peach Fuzzer [rooted2017]RootedCON
 
Users' Data Security in iOS Applications
Users' Data Security in iOS ApplicationsUsers' Data Security in iOS Applications
Users' Data Security in iOS ApplicationsStanfy
 

What's hot (20)

Cryptography 101 for_java_developers, Fall 2019
Cryptography 101 for_java_developers, Fall 2019Cryptography 101 for_java_developers, Fall 2019
Cryptography 101 for_java_developers, Fall 2019
 
Cryptography 101 for Java developers
Cryptography 101 for Java developersCryptography 101 for Java developers
Cryptography 101 for Java developers
 
Toni de la Fuente - Automate or die! How to survive to an attack in the Cloud...
Toni de la Fuente - Automate or die! How to survive to an attack in the Cloud...Toni de la Fuente - Automate or die! How to survive to an attack in the Cloud...
Toni de la Fuente - Automate or die! How to survive to an attack in the Cloud...
 
SSL/TLS for Mortals (J-Fall)
SSL/TLS for Mortals (J-Fall)SSL/TLS for Mortals (J-Fall)
SSL/TLS for Mortals (J-Fall)
 
SSL/TLS for Mortals (GOTO Berlin)
SSL/TLS for Mortals (GOTO Berlin)SSL/TLS for Mortals (GOTO Berlin)
SSL/TLS for Mortals (GOTO Berlin)
 
6.1. iCloud keychain and iOS 7 data protection
6.1. iCloud keychain and iOS 7 data protection6.1. iCloud keychain and iOS 7 data protection
6.1. iCloud keychain and iOS 7 data protection
 
JavaFest. Nanne Baars. Web application security for developers
JavaFest. Nanne Baars. Web application security for developersJavaFest. Nanne Baars. Web application security for developers
JavaFest. Nanne Baars. Web application security for developers
 
[DefCon 2016] I got 99 Problems, but 
Little Snitch ain’t one!
[DefCon 2016] I got 99 Problems, but 
Little Snitch ain’t one![DefCon 2016] I got 99 Problems, but 
Little Snitch ain’t one!
[DefCon 2016] I got 99 Problems, but 
Little Snitch ain’t one!
 
Active Directory Recon 101
Active Directory Recon 101Active Directory Recon 101
Active Directory Recon 101
 
SSL/TLS for Mortals (Devoxx FR 2018)
SSL/TLS for Mortals (Devoxx FR 2018)SSL/TLS for Mortals (Devoxx FR 2018)
SSL/TLS for Mortals (Devoxx FR 2018)
 
Mimikatz
MimikatzMimikatz
Mimikatz
 
Hacking intranet websites
Hacking intranet websitesHacking intranet websites
Hacking intranet websites
 
OpenStack Folsom Summit: Melange overview
OpenStack Folsom Summit: Melange overviewOpenStack Folsom Summit: Melange overview
OpenStack Folsom Summit: Melange overview
 
iOS Automation Primitives
iOS Automation PrimitivesiOS Automation Primitives
iOS Automation Primitives
 
SSL/TLS for Mortals (JavaZone)
SSL/TLS for Mortals (JavaZone)SSL/TLS for Mortals (JavaZone)
SSL/TLS for Mortals (JavaZone)
 
Pa or die
Pa or diePa or die
Pa or die
 
Yihan Lian & Zhibin Hu - Smarter Peach: Add Eyes to Peach Fuzzer [rooted2017]
Yihan Lian &  Zhibin Hu - Smarter Peach: Add Eyes to Peach Fuzzer [rooted2017]Yihan Lian &  Zhibin Hu - Smarter Peach: Add Eyes to Peach Fuzzer [rooted2017]
Yihan Lian & Zhibin Hu - Smarter Peach: Add Eyes to Peach Fuzzer [rooted2017]
 
H0 w decrypt
H0 w decryptH0 w decrypt
H0 w decrypt
 
Users' Data Security in iOS Applications
Users' Data Security in iOS ApplicationsUsers' Data Security in iOS Applications
Users' Data Security in iOS Applications
 
Vault 101
Vault 101Vault 101
Vault 101
 

Viewers also liked

iOS-Application-Security-iAmPr3m
iOS-Application-Security-iAmPr3miOS-Application-Security-iAmPr3m
iOS-Application-Security-iAmPr3mPrem Kumar (OSCP)
 
iOS Security and Encryption
iOS Security and EncryptioniOS Security and Encryption
iOS Security and EncryptionUrvashi Kataria
 
iOS Application Security
iOS Application SecurityiOS Application Security
iOS Application SecurityEgor Tolstoy
 
Mobile Device Encryption Systems
Mobile Device Encryption SystemsMobile Device Encryption Systems
Mobile Device Encryption SystemsPeter Teufl
 
Hacking and Securing iOS Apps : Part 1
Hacking and Securing iOS Apps : Part 1Hacking and Securing iOS Apps : Part 1
Hacking and Securing iOS Apps : Part 1Subhransu Behera
 
iOS secure app development
iOS secure app developmentiOS secure app development
iOS secure app developmentDusan Klinec
 
iOS Application Penetration Testing for Beginners
iOS Application Penetration Testing for BeginnersiOS Application Penetration Testing for Beginners
iOS Application Penetration Testing for BeginnersRyanISI
 
IOS Encryption Systems
IOS Encryption SystemsIOS Encryption Systems
IOS Encryption SystemsPeter Teufl
 
Unit testing for Cocoa developers
Unit testing for Cocoa developersUnit testing for Cocoa developers
Unit testing for Cocoa developersGraham Lee
 
Beyond build and analyze
Beyond build and analyzeBeyond build and analyze
Beyond build and analyzeGraham Lee
 
AES encryption on modern consumer architectures
AES encryption on modern consumer architecturesAES encryption on modern consumer architectures
AES encryption on modern consumer architecturesGrigore Lupescu
 
Manufacturers of Fire Detection Equipment
Manufacturers of Fire Detection EquipmentManufacturers of Fire Detection Equipment
Manufacturers of Fire Detection EquipmentGlobal Fire Equipment
 
Data Decryption & Password Recovery
Data Decryption & Password RecoveryData Decryption & Password Recovery
Data Decryption & Password RecoveryAndrey Belenko
 
Защита данных безнеса с помощью шифрования
Защита данных безнеса с помощью шифрованияЗащита данных безнеса с помощью шифрования
Защита данных безнеса с помощью шифрованияVladyslav Radetsky
 
A (not-so-quick) Primer on iOS Encryption David Schuetz - NCC Group
A (not-so-quick) Primer on iOS Encryption David Schuetz - NCC GroupA (not-so-quick) Primer on iOS Encryption David Schuetz - NCC Group
A (not-so-quick) Primer on iOS Encryption David Schuetz - NCC GroupEC-Council
 

Viewers also liked (20)

iOS-Application-Security-iAmPr3m
iOS-Application-Security-iAmPr3miOS-Application-Security-iAmPr3m
iOS-Application-Security-iAmPr3m
 
iOS Security and Encryption
iOS Security and EncryptioniOS Security and Encryption
iOS Security and Encryption
 
iOS Application Security
iOS Application SecurityiOS Application Security
iOS Application Security
 
Mobile Device Encryption Systems
Mobile Device Encryption SystemsMobile Device Encryption Systems
Mobile Device Encryption Systems
 
iOS Application Penetration Testing
iOS Application Penetration TestingiOS Application Penetration Testing
iOS Application Penetration Testing
 
Hacking and Securing iOS Apps : Part 1
Hacking and Securing iOS Apps : Part 1Hacking and Securing iOS Apps : Part 1
Hacking and Securing iOS Apps : Part 1
 
iOS secure app development
iOS secure app developmentiOS secure app development
iOS secure app development
 
iOS Application Penetration Testing for Beginners
iOS Application Penetration Testing for BeginnersiOS Application Penetration Testing for Beginners
iOS Application Penetration Testing for Beginners
 
IOS Encryption Systems
IOS Encryption SystemsIOS Encryption Systems
IOS Encryption Systems
 
Unit testing for Cocoa developers
Unit testing for Cocoa developersUnit testing for Cocoa developers
Unit testing for Cocoa developers
 
Beyond build and analyze
Beyond build and analyzeBeyond build and analyze
Beyond build and analyze
 
AES encryption on modern consumer architectures
AES encryption on modern consumer architecturesAES encryption on modern consumer architectures
AES encryption on modern consumer architectures
 
Manufacturers of Fire Detection Equipment
Manufacturers of Fire Detection EquipmentManufacturers of Fire Detection Equipment
Manufacturers of Fire Detection Equipment
 
Data Decryption & Password Recovery
Data Decryption & Password RecoveryData Decryption & Password Recovery
Data Decryption & Password Recovery
 
iOS Application Exploitation
iOS Application ExploitationiOS Application Exploitation
iOS Application Exploitation
 
iOS Application Pentesting
iOS Application PentestingiOS Application Pentesting
iOS Application Pentesting
 
Защита данных безнеса с помощью шифрования
Защита данных безнеса с помощью шифрованияЗащита данных безнеса с помощью шифрования
Защита данных безнеса с помощью шифрования
 
McAfee Encryption 2015
McAfee Encryption 2015McAfee Encryption 2015
McAfee Encryption 2015
 
McAfee Endpoint Security 10.1
McAfee Endpoint Security 10.1McAfee Endpoint Security 10.1
McAfee Endpoint Security 10.1
 
A (not-so-quick) Primer on iOS Encryption David Schuetz - NCC Group
A (not-so-quick) Primer on iOS Encryption David Schuetz - NCC GroupA (not-so-quick) Primer on iOS Encryption David Schuetz - NCC Group
A (not-so-quick) Primer on iOS Encryption David Schuetz - NCC Group
 

Similar to Security and Encryption on iOS

Java Symmetric
Java SymmetricJava Symmetric
Java Symmetricphanleson
 
Cargo Cult Security at OpenWest
Cargo Cult Security at OpenWestCargo Cult Security at OpenWest
Cargo Cult Security at OpenWestDerrick Isaacson
 
Cargo Cult Security UJUG Sep2015
Cargo Cult Security UJUG Sep2015Cargo Cult Security UJUG Sep2015
Cargo Cult Security UJUG Sep2015Derrick Isaacson
 
Cryptography 101 for Java developers
Cryptography 101 for Java developersCryptography 101 for Java developers
Cryptography 101 for Java developersMichel Schudel
 
7.3. iCloud keychain-2
7.3. iCloud keychain-27.3. iCloud keychain-2
7.3. iCloud keychain-2defconmoscow
 
A tale of application development
A tale of application developmentA tale of application development
A tale of application developmentNicolas Corrarello
 
Cargo Cult Security 2014_01_18
Cargo Cult Security 2014_01_18Cargo Cult Security 2014_01_18
Cargo Cult Security 2014_01_18Derrick Isaacson
 
Zeronights 2016 - Automating iOS blackbox security scanning
Zeronights 2016 - Automating iOS blackbox security scanningZeronights 2016 - Automating iOS blackbox security scanning
Zeronights 2016 - Automating iOS blackbox security scanningSynack
 
ZeroNights: Automating iOS blackbox security scanning
ZeroNights: Automating iOS blackbox security scanningZeroNights: Automating iOS blackbox security scanning
ZeroNights: Automating iOS blackbox security scanningMikhail Sosonkin
 
Encryption Boot Camp at JavaZone 2010
Encryption Boot Camp at JavaZone 2010Encryption Boot Camp at JavaZone 2010
Encryption Boot Camp at JavaZone 2010Matthew McCullough
 
Tutorial s crypto api session keys
Tutorial   s crypto api session keysTutorial   s crypto api session keys
Tutorial s crypto api session keysDr. Edwin Hernandez
 
CSW2017 Henry li how to find the vulnerability to bypass the control flow gua...
CSW2017 Henry li how to find the vulnerability to bypass the control flow gua...CSW2017 Henry li how to find the vulnerability to bypass the control flow gua...
CSW2017 Henry li how to find the vulnerability to bypass the control flow gua...CanSecWest
 
Cryptography In Silverlight
Cryptography In SilverlightCryptography In Silverlight
Cryptography In SilverlightBarry Dorrans
 
Hadoop Security Now and Future
Hadoop Security Now and FutureHadoop Security Now and Future
Hadoop Security Now and Futuretcloudcomputing-tw
 
Exploring the Cryptol Toolset
Exploring the Cryptol ToolsetExploring the Cryptol Toolset
Exploring the Cryptol ToolsetUlisses Costa
 
#ifndef CRYPTO_HPP#define CRYPTO_HPP#include functional#.docx
#ifndef CRYPTO_HPP#define CRYPTO_HPP#include functional#.docx#ifndef CRYPTO_HPP#define CRYPTO_HPP#include functional#.docx
#ifndef CRYPTO_HPP#define CRYPTO_HPP#include functional#.docxgertrudebellgrove
 
Symmetric key encryption new approach
Symmetric key encryption new approachSymmetric key encryption new approach
Symmetric key encryption new approachmdhar123
 

Similar to Security and Encryption on iOS (20)

Java Symmetric
Java SymmetricJava Symmetric
Java Symmetric
 
Onward15
Onward15Onward15
Onward15
 
Cargo Cult Security at OpenWest
Cargo Cult Security at OpenWestCargo Cult Security at OpenWest
Cargo Cult Security at OpenWest
 
Cargo Cult Security UJUG Sep2015
Cargo Cult Security UJUG Sep2015Cargo Cult Security UJUG Sep2015
Cargo Cult Security UJUG Sep2015
 
Cryptography 101 for Java developers
Cryptography 101 for Java developersCryptography 101 for Java developers
Cryptography 101 for Java developers
 
7.3. iCloud keychain-2
7.3. iCloud keychain-27.3. iCloud keychain-2
7.3. iCloud keychain-2
 
A tale of application development
A tale of application developmentA tale of application development
A tale of application development
 
Cargo Cult Security 2014_01_18
Cargo Cult Security 2014_01_18Cargo Cult Security 2014_01_18
Cargo Cult Security 2014_01_18
 
Zeronights 2016 - Automating iOS blackbox security scanning
Zeronights 2016 - Automating iOS blackbox security scanningZeronights 2016 - Automating iOS blackbox security scanning
Zeronights 2016 - Automating iOS blackbox security scanning
 
ZeroNights: Automating iOS blackbox security scanning
ZeroNights: Automating iOS blackbox security scanningZeroNights: Automating iOS blackbox security scanning
ZeroNights: Automating iOS blackbox security scanning
 
Encryption Boot Camp at JavaZone 2010
Encryption Boot Camp at JavaZone 2010Encryption Boot Camp at JavaZone 2010
Encryption Boot Camp at JavaZone 2010
 
Tutorial s crypto api session keys
Tutorial   s crypto api session keysTutorial   s crypto api session keys
Tutorial s crypto api session keys
 
CSW2017 Henry li how to find the vulnerability to bypass the control flow gua...
CSW2017 Henry li how to find the vulnerability to bypass the control flow gua...CSW2017 Henry li how to find the vulnerability to bypass the control flow gua...
CSW2017 Henry li how to find the vulnerability to bypass the control flow gua...
 
Cryptography In Silverlight
Cryptography In SilverlightCryptography In Silverlight
Cryptography In Silverlight
 
Django cryptography
Django cryptographyDjango cryptography
Django cryptography
 
Hadoop Security Now and Future
Hadoop Security Now and FutureHadoop Security Now and Future
Hadoop Security Now and Future
 
Cryptography using python
Cryptography using pythonCryptography using python
Cryptography using python
 
Exploring the Cryptol Toolset
Exploring the Cryptol ToolsetExploring the Cryptol Toolset
Exploring the Cryptol Toolset
 
#ifndef CRYPTO_HPP#define CRYPTO_HPP#include functional#.docx
#ifndef CRYPTO_HPP#define CRYPTO_HPP#include functional#.docx#ifndef CRYPTO_HPP#define CRYPTO_HPP#include functional#.docx
#ifndef CRYPTO_HPP#define CRYPTO_HPP#include functional#.docx
 
Symmetric key encryption new approach
Symmetric key encryption new approachSymmetric key encryption new approach
Symmetric key encryption new approach
 

More from Graham Lee

Object-Oriented Programming in Functional Programming in Swift
Object-Oriented Programming in Functional Programming in SwiftObject-Oriented Programming in Functional Programming in Swift
Object-Oriented Programming in Functional Programming in SwiftGraham Lee
 
The Principled Programmer
The Principled ProgrammerThe Principled Programmer
The Principled ProgrammerGraham Lee
 
Cross platform Objective-C Strategy
Cross platform Objective-C StrategyCross platform Objective-C Strategy
Cross platform Objective-C StrategyGraham Lee
 
Taking a Test Drive: iOS Dev UK guide to TDD
Taking a Test Drive: iOS Dev UK guide to TDDTaking a Test Drive: iOS Dev UK guide to TDD
Taking a Test Drive: iOS Dev UK guide to TDDGraham Lee
 
Taking a Test Drive
Taking a Test DriveTaking a Test Drive
Taking a Test DriveGraham Lee
 
Crypto storage
Crypto storageCrypto storage
Crypto storageGraham Lee
 
Smartphone security and privacy: you're doing it wrong
Smartphone security and privacy: you're doing it wrongSmartphone security and privacy: you're doing it wrong
Smartphone security and privacy: you're doing it wrongGraham Lee
 
Sign your code
Sign your codeSign your code
Sign your codeGraham Lee
 
Dial M For Mitigation
Dial M For MitigationDial M For Mitigation
Dial M For MitigationGraham Lee
 
Presentations and Podcasts - OxMug July 2009
Presentations and Podcasts - OxMug July 2009Presentations and Podcasts - OxMug July 2009
Presentations and Podcasts - OxMug July 2009Graham Lee
 
Intel Briefing Notes
Intel Briefing NotesIntel Briefing Notes
Intel Briefing NotesGraham Lee
 
Designing a Secure Cocoa App
Designing a Secure Cocoa AppDesigning a Secure Cocoa App
Designing a Secure Cocoa AppGraham Lee
 

More from Graham Lee (12)

Object-Oriented Programming in Functional Programming in Swift
Object-Oriented Programming in Functional Programming in SwiftObject-Oriented Programming in Functional Programming in Swift
Object-Oriented Programming in Functional Programming in Swift
 
The Principled Programmer
The Principled ProgrammerThe Principled Programmer
The Principled Programmer
 
Cross platform Objective-C Strategy
Cross platform Objective-C StrategyCross platform Objective-C Strategy
Cross platform Objective-C Strategy
 
Taking a Test Drive: iOS Dev UK guide to TDD
Taking a Test Drive: iOS Dev UK guide to TDDTaking a Test Drive: iOS Dev UK guide to TDD
Taking a Test Drive: iOS Dev UK guide to TDD
 
Taking a Test Drive
Taking a Test DriveTaking a Test Drive
Taking a Test Drive
 
Crypto storage
Crypto storageCrypto storage
Crypto storage
 
Smartphone security and privacy: you're doing it wrong
Smartphone security and privacy: you're doing it wrongSmartphone security and privacy: you're doing it wrong
Smartphone security and privacy: you're doing it wrong
 
Sign your code
Sign your codeSign your code
Sign your code
 
Dial M For Mitigation
Dial M For MitigationDial M For Mitigation
Dial M For Mitigation
 
Presentations and Podcasts - OxMug July 2009
Presentations and Podcasts - OxMug July 2009Presentations and Podcasts - OxMug July 2009
Presentations and Podcasts - OxMug July 2009
 
Intel Briefing Notes
Intel Briefing NotesIntel Briefing Notes
Intel Briefing Notes
 
Designing a Secure Cocoa App
Designing a Secure Cocoa AppDesigning a Secure Cocoa App
Designing a Secure Cocoa App
 

Recently uploaded

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 

Recently uploaded (20)

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 

Security and Encryption on iOS

  • 1. Security and Encryption 16ccf74271895e611555bf1f00047944
  • 3. Security Requirements Documents High Scores Multiplayer Chat
  • 4. Security Requirements Documents High Scores Multiplayer Chat
  • 5. Security Requirements Content State Ads
  • 8. Security Requirements • Ask the user (or client, product manager…)
  • 9. Security Requirements • Ask the user (or client, product manager…) • But don’t expect them to know the answer!
  • 10. Security Requirements • Ask the user (or client, product manager…) • But don’t expect them to know the answer! Confidentiality Exposure
  • 11. Security Requirements • Ask the user (or client, product manager…) • But don’t expect them to know the answer! Confidentiality Exposure Integrity Tampering
  • 12. Security Requirements • Ask the user (or client, product manager…) • But don’t expect them to know the answer! Confidentiality Exposure Integrity Tampering Availability Destruction
  • 13. Security Requirements “In an incident that highlights the growing security challenges around wireless apps, Citi said its iPhone app accidentally saved personal account information in a hidden file on users' iPhones. Information that may have been stored includes their account numbers, bill payments and security access codes.” http://www.nypost.com/p/news/business/citibank_admits_security_flaw_in_fDLT7l6VFdqKLLaTx75cYM
  • 14. Don’t copy me, bro iTunes ignores: •Library/Caches •tmp not: •Documents •Library/Preferences •Library/Application Support
  • 19. Use Data Protection [myData writeToURL: location options: NSDataWritingFileProtectionComplete error: &error];
  • 20. Use Data Protection [myData writeToURL: location options: NSDataWritingFileProtectionComplete error: &error]; NOT [[NSFileManager defaultManager] setAttributes: [NSDictionary dictionaryWithObject: NSFileProtectionComplete forKey: NSFileProtectionKey] ofItemAtPath: [location path] error: &error];
  • 21. Use Data Protection [myData writeToURL: location options: NSDataWritingFileProtectionComplete error: &error];
  • 22. Use the Keychain • mostly just works… • kSecReturnRef usually fails • kSecMatchItemList succeeds wrongly(!) • easiest to use attributes/persistent refs and kSecReturnData
  • 23. Finding a Keychain Item NSDictionary *foundAttributes = nil; NSDictionary *searchAttributes = [NSDictionary dictionaryWithObjectsAndKeys: [@"info.thaesofereode.samplepassword" dataUsingEncoding: NSUTF8StringEncoding], kSecAttrApplicationTag, kCFBooleanTrue, kSecReturnAttributes, nil]; OSStatus searchResult = SecItemCopyMatching(searchAttributes, &foundAttributes); if (noErr == searchResult) { // use the keychain item Source: Professional Cocoa Application Security
  • 24. Saving a Keychain Item attributesToStore = [searchAttributes mutableCopy]; [attributesToStore setObject: self.userNameField.text forKey: kSecAttrAccount]; [attributesToStore setObject: passwordData forKey: kSecValueData]; [attributesToStore setObject: kSecClassInternetPassword forKey: kSecClass]; [attributesToStore setObject: @"www.example.com" forKey: kSecAttrServer]; [attributesToStore setObject: kCFBooleanTrue forKey: kSecReturnPersistentRef]; [attributesToStore setObject: @"Sample password" forKey: kSecAttrDescription]; [attributesToStore setObject: @"password label" forKey: kSecAttrLabel]; [attributesToStore removeObjectForKey: kSecReturnAttributes]; NSData *persistentRef = nil; OSStatus result = SecItemAdd(attributesToStore, &persistentRef); Source: Professional Cocoa Application Security
  • 25. Encrypt Files Yourself • CommonCrypto • OpenSSL
  • 26. Encrypt Files Yourself • Choose appropriate algorithm, key size, mode • Note the bootstrap problem • Get randomness from SecRandomCopyBytes()
  • 27. Encrypt Files Yourself size_t bytesNeeded = 0; CCCryptorStatus cryptResult = kCCSuccess; cryptResult = CCCrypt(kCCEncrypt, kCCAlgorithmAES128, kCCOptionPKCS7Padding, [key bytes], [key length], kCCOptionPKCS7Padding, [iv bytes], [key bytes], [plainText bytes], [key length], [plainText length], [iv bytes], NULL, [plainText bytes], 0, [plainText length], &bytesNeeded); cipherBytes, if (kCCBufferTooSmall != cryptResult) { bufferLength, *error = [NSError errorWithDomain: &bytesNeeded); GLFileEncryptorErrorDomain if (kCCSuccess != cryptResult) { code: GLFileEncryptorCryptFailed *error = [NSError errorWithDomain: userInfo: nil]; GLFileEncryptorErrorDomain return nil; code: GLFileEncryptorCryptFailed } userInfo: nil]; char *cipherBytes = malloc(bytesNeeded); free(cipherBytes); size_t bufferLength = bytesNeeded; return nil; if (NULL == cipherBytes) { } *error = [NSError errorWithDomain: GLFileEncryptorErrorDomain code: GLFileEncryptorOutOfMemory userInfo: nil]; return nil; } // now actually encrypt the file cryptResult = CCCrypt(kCCEncrypt, kCCAlgorithmAES128, Source: Professional Cocoa Application Security
  • 28. Non-solutions • Write your own encryption algorithm • Wait until someone reports the problem
  • 29.
  • 30.

Editor's Notes

  1. The subtitle is “A guide to protecting your users on iOS”. Who I am, where we’re going. Start with security requirements.
  2. Even standalone apps have security requirements (most iOS devices can easily be lost), they just tend to get more complex as you add remote connections. However, no app on iOS is truly “standalone” - they all share data with iTunes. You can’t (reliably) control whether users encrypt their backups, or use PIN locks, or avoid mistakes (or can you?).
  3. Even standalone apps have security requirements (most iOS devices can easily be lost), they just tend to get more complex as you add remote connections. However, no app on iOS is truly “standalone” - they all share data with iTunes. You can’t (reliably) control whether users encrypt their backups, or use PIN locks, or avoid mistakes (or can you?).
  4. Even standalone apps have security requirements (most iOS devices can easily be lost), they just tend to get more complex as you add remote connections. However, no app on iOS is truly “standalone” - they all share data with iTunes. You can’t (reliably) control whether users encrypt their backups, or use PIN locks, or avoid mistakes (or can you?).
  5. Even standalone apps have security requirements (most iOS devices can easily be lost), they just tend to get more complex as you add remote connections. However, no app on iOS is truly “standalone” - they all share data with iTunes. You can’t (reliably) control whether users encrypt their backups, or use PIN locks, or avoid mistakes (or can you?).
  6. Even standalone apps have security requirements (most iOS devices can easily be lost), they just tend to get more complex as you add remote connections. However, no app on iOS is truly “standalone” - they all share data with iTunes. You can’t (reliably) control whether users encrypt their backups, or use PIN locks, or avoid mistakes (or can you?).
  7. Even standalone apps have security requirements (most iOS devices can easily be lost), they just tend to get more complex as you add remote connections. However, no app on iOS is truly “standalone” - they all share data with iTunes. You can’t (reliably) control whether users encrypt their backups, or use PIN locks, or avoid mistakes (or can you?).
  8. Even standalone apps have security requirements (most iOS devices can easily be lost), they just tend to get more complex as you add remote connections. However, no app on iOS is truly “standalone” - they all share data with iTunes. You can’t (reliably) control whether users encrypt their backups, or use PIN locks, or avoid mistakes (or can you?).
  9. Even standalone apps have security requirements (most iOS devices can easily be lost), they just tend to get more complex as you add remote connections. However, no app on iOS is truly “standalone” - they all share data with iTunes. You can’t (reliably) control whether users encrypt their backups, or use PIN locks, or avoid mistakes (or can you?).
  10. Even standalone apps have security requirements (most iOS devices can easily be lost), they just tend to get more complex as you add remote connections. However, no app on iOS is truly “standalone” - they all share data with iTunes. You can’t (reliably) control whether users encrypt their backups, or use PIN locks, or avoid mistakes (or can you?).
  11. Even standalone apps have security requirements (most iOS devices can easily be lost), they just tend to get more complex as you add remote connections. However, no app on iOS is truly “standalone” - they all share data with iTunes. You can’t (reliably) control whether users encrypt their backups, or use PIN locks, or avoid mistakes (or can you?).
  12. Even standalone apps have security requirements (most iOS devices can easily be lost), they just tend to get more complex as you add remote connections. However, no app on iOS is truly “standalone” - they all share data with iTunes. You can’t (reliably) control whether users encrypt their backups, or use PIN locks, or avoid mistakes (or can you?).
  13. Even standalone apps have security requirements (most iOS devices can easily be lost), they just tend to get more complex as you add remote connections. However, no app on iOS is truly “standalone” - they all share data with iTunes. You can’t (reliably) control whether users encrypt their backups, or use PIN locks, or avoid mistakes (or can you?).
  14. Even standalone apps have security requirements (most iOS devices can easily be lost), they just tend to get more complex as you add remote connections. However, no app on iOS is truly “standalone” - they all share data with iTunes. You can’t (reliably) control whether users encrypt their backups, or use PIN locks, or avoid mistakes (or can you?).
  15. Users and product managers will likely think that “make it secure” is an implicit requirement, or not fully understand the requirements. Find out security properties by asking questions about the assets - reflective questions are better than hypotheticals. Any potential problem is a disaster that needs to be avoided at all costs.
  16. Users and product managers will likely think that “make it secure” is an implicit requirement, or not fully understand the requirements. Find out security properties by asking questions about the assets - reflective questions are better than hypotheticals. Any potential problem is a disaster that needs to be avoided at all costs.
  17. Users and product managers will likely think that “make it secure” is an implicit requirement, or not fully understand the requirements. Find out security properties by asking questions about the assets - reflective questions are better than hypotheticals. Any potential problem is a disaster that needs to be avoided at all costs.
  18. Users and product managers will likely think that “make it secure” is an implicit requirement, or not fully understand the requirements. Find out security properties by asking questions about the assets - reflective questions are better than hypotheticals. Any potential problem is a disaster that needs to be avoided at all costs.
  19. Users and product managers will likely think that “make it secure” is an implicit requirement, or not fully understand the requirements. Find out security properties by asking questions about the assets - reflective questions are better than hypotheticals. Any potential problem is a disaster that needs to be avoided at all costs.
  20. Users and product managers will likely think that “make it secure” is an implicit requirement, or not fully understand the requirements. Find out security properties by asking questions about the assets - reflective questions are better than hypotheticals. Any potential problem is a disaster that needs to be avoided at all costs.
  21. Users and product managers will likely think that “make it secure” is an implicit requirement, or not fully understand the requirements. Find out security properties by asking questions about the assets - reflective questions are better than hypotheticals. Any potential problem is a disaster that needs to be avoided at all costs.
  22. Users and product managers will likely think that “make it secure” is an implicit requirement, or not fully understand the requirements. Find out security properties by asking questions about the assets - reflective questions are better than hypotheticals. Any potential problem is a disaster that needs to be avoided at all costs.
  23. Users and product managers will likely think that “make it secure” is an implicit requirement, or not fully understand the requirements. Find out security properties by asking questions about the assets - reflective questions are better than hypotheticals. Any potential problem is a disaster that needs to be avoided at all costs.
  24. There will also be regulatory/legal/contractual requirements in some fields. I’m not picking on Citi here, but this is a good recent example of the fact that mobile app security is a real-world problem with real-world consequences. Let’s look at some solutions to this problem.
  25. To avoid files appearing in iTunes backups (and therefore worrying about whether the backups are encrypted), put it in one of the cache folders. That’s really only a reliable solution when you can easily recover the content.
  26. Files created with iOS data protection are encrypted using the device key (the same key that protects the keychain), and only accessible when the device is unlocked.
  27. Files created with iOS data protection are encrypted using the device key (the same key that protects the keychain), and only accessible when the device is unlocked.
  28. Files created with iOS data protection are encrypted using the device key (the same key that protects the keychain), and only accessible when the device is unlocked.
  29. Files created with iOS data protection are encrypted using the device key (the same key that protects the keychain), and only accessible when the device is unlocked.
  30. Files created with iOS data protection are encrypted using the device key (the same key that protects the keychain), and only accessible when the device is unlocked.
  31. Files created with iOS data protection are encrypted using the device key (the same key that protects the keychain), and only accessible when the device is unlocked.
  32. Files created with iOS data protection are encrypted using the device key (the same key that protects the keychain), and only accessible when the device is unlocked.
  33. Files created with iOS data protection are encrypted using the device key (the same key that protects the keychain), and only accessible when the device is unlocked.
  34. Files created with iOS data protection are encrypted using the device key (the same key that protects the keychain), and only accessible when the device is unlocked.
  35. Files created with iOS data protection are encrypted using the device key (the same key that protects the keychain), and only accessible when the device is unlocked.
  36. Files created with iOS data protection are encrypted using the device key (the same key that protects the keychain), and only accessible when the device is unlocked.
  37. Files created with iOS data protection are encrypted using the device key (the same key that protects the keychain), and only accessible when the device is unlocked.
  38. Files created with iOS data protection are encrypted using the device key (the same key that protects the keychain), and only accessible when the device is unlocked.
  39. Files created with iOS data protection are encrypted using the device key (the same key that protects the keychain), and only accessible when the device is unlocked.
  40. Files created with iOS data protection are encrypted using the device key (the same key that protects the keychain), and only accessible when the device is unlocked.
  41. Files created with iOS data protection are encrypted using the device key (the same key that protects the keychain), and only accessible when the device is unlocked.
  42. Files created with iOS data protection are encrypted using the device key (the same key that protects the keychain), and only accessible when the device is unlocked.
  43. Files created with iOS data protection are encrypted using the device key (the same key that protects the keychain), and only accessible when the device is unlocked.
  44. Files created with iOS data protection are encrypted using the device key (the same key that protects the keychain), and only accessible when the device is unlocked.
  45. Files created with iOS data protection are encrypted using the device key (the same key that protects the keychain), and only accessible when the device is unlocked.
  46. Files created with iOS data protection are encrypted using the device key (the same key that protects the keychain), and only accessible when the device is unlocked.
  47. Files created with iOS data protection are encrypted using the device key (the same key that protects the keychain), and only accessible when the device is unlocked.
  48. Files created with iOS data protection are encrypted using the device key (the same key that protects the keychain), and only accessible when the device is unlocked.
  49. Files created with iOS data protection are encrypted using the device key (the same key that protects the keychain), and only accessible when the device is unlocked.
  50. Files created with iOS data protection are encrypted using the device key (the same key that protects the keychain), and only accessible when the device is unlocked.
  51. Create and encrypt the file in a single operation, don’t protect an existing file (unless you can’t help it, e.g. applying protection in an app version upgrade). That can die in a fire.
  52. Create and encrypt the file in a single operation, don’t protect an existing file (unless you can’t help it, e.g. applying protection in an app version upgrade). That can die in a fire.
  53. Create and encrypt the file in a single operation, don’t protect an existing file (unless you can’t help it, e.g. applying protection in an app version upgrade). That can die in a fire.
  54. Create and encrypt the file in a single operation, don’t protect an existing file (unless you can’t help it, e.g. applying protection in an app version upgrade). That can die in a fire.
  55. The keychain API on iOS is much simpler than the desktop one, but suffers from poor error reporting and lightly-documented failure conditions. The content is protected by the device key, and restricted to your app (unless you set up group entries). Keychain is great for small pieces of data like OAuth tokens and passwords.
  56. Both trusted and stable APIs, CC is Mac/iPhone while OpenSSL is available anywhere. Can be used to encrypt streams in addition to files.
  57. Key length affects the time (and battery) required to do the encryption, and the time taken for a brute-force attack to succeed. Keys and IVs must be protected.