iOS development - tips & tricks

Stefan Tsvyatkov
Stefan TsvyatkoviOS Practice Manager at MentorMate България
iOS Development - Tips & Tricks
iOS Development - Tips & Tricks
Software Development Lead - iOS
Galin Kardzhilov
Software Development Manager - iOS
Stefan Tsvyatkov
iOS Development - Tips & Tricks
Agenda
 Why iOS

 Some challenges

 iOS Security
iOS Development - Tips & Tricks
About Me
 Started with
iOS Development - Tips & Tricks
About Me
iOS Development - Tips & Tricks
Why iOS?
-(NSString *)generateReasonsWhyiOS {
NSMutableString *reasons = [[NSMutableString alloc] init];
[reasons appendString:@"It's new"];
[reasons appendString:@"It's challenging"];
[reasons appendString:@"It compiles to native"];
[reasons appendString:@"You have to deal with hardware limitations"];
[reasons appendString:@"You have to provide responsiveness"];
[reasons appendString:@"You have to provide usability"];
[reasons appendString:@"You have to provide security"];
[reasons appendString:@"0ften craftsmanship
[reasons appendString:@"Your code runs into people's pockets"];
return reasons;
}
iOS Development - Tips & Tricks
 Table view
 Background image
 Custom drawn cells
… flipped
Watch video @ http://youtu.be/Um971SFzOfQ
iOS Development - Tips & Tricks
Watch video @ http://youtu.be/HrK6PevFYkI
iOS Development - Tips & Tricks
Scroll View
Custom View
iOS Development - Tips & Tricks
iOS Development - Tips & Tricks
Security in iOS
 Local Storage

 Communication with the server

 Binary analysis and manipulation
iOS Development - Tips & Tricks
Local Storage Security
 NSUserDefaults

 Convenient

 Not encrypted by
default

 Keeps the data in a
plist file
 CoreData

 Not encrypted by
default

 Keeps the data in
sqlite db
Not secure
iOS Development - Tips & Tricks
Local Storage Security
 Keychain Access

 Encrypted by default

 A bit more complex for use

 Insecure on jailbroken devices
 Data encryption

 Crypto API

 Obfuscate the encryption key

 Use unique device information
String constant

[[UIDevice
currentDevice]
identifierForVendor]

Custom
algorith
Secure encryption
iOS Development - Tips & Tricks
Server Communication Security
 Use SSL

 Don’t accept self-signed certificates

 Client and server side data validation
iOS Development - Tips & Tricks
Runtime Manipulation
#import "AppDelegate.h"
#import "ptrace.h"
!
int main(int argc, char * argv[])
{
#ifndef DEBUG
ptrace(PT_DENY_ATTACH, 0, 0, 0);
#endif
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
 ptrace

 Deny a debugger to attach

 Can be patched from binary

 Put it in multiple places
iOS Development - Tips & Tricks
!
 SEC_IS_BEING_DEBUGGED_RETURN_NIL()

!
!
!
!
!
!
 Check if a debugger is attached

 Hard to be patched from binary

 Make the check regularly and in critical
parts

 Doesn’t work against Cycript
Runtime Manipulation
#ifndef DEBUG
SEC_IS_BEING_DEBUGGED_RETURN_NIL();
#endif
iOS Development - Tips & Tricks
Conclusion
 Keychain Access for storing

 SSL for transporting

 Check for debuggers

 100% security does not exist
iOS Development - Tips & Tricks
Thank you!
Galin Kardzhilov @gravera
Stefan Tsvyatkov @stsvyatkov
1 of 17

Recommended

iOS Development - Tips & Tricks by
iOS Development - Tips & TricksiOS Development - Tips & Tricks
iOS Development - Tips & Tricksit-tour
357 views17 slides
Wordpress Security Tips by
Wordpress Security TipsWordpress Security Tips
Wordpress Security TipsLalit Nama
394 views25 slides
CDE personalised learning by
CDE personalised learningCDE personalised learning
CDE personalised learningJames Ballard
301 views20 slides
JISC RSC London Workshop - Learner analytics by
JISC RSC London Workshop - Learner analyticsJISC RSC London Workshop - Learner analytics
JISC RSC London Workshop - Learner analyticsJames Ballard
604 views36 slides
Learner enhanced technology by
Learner enhanced technologyLearner enhanced technology
Learner enhanced technologyJames Ballard
342 views23 slides
Question 1 by
Question 1 Question 1
Question 1 Yacine Boudjeltia
249 views7 slides

More Related Content

Viewers also liked

Question 1 by
Question 1 Question 1
Question 1 Yacine Boudjeltia
82 views6 slides
The a&h bomb by
The a&h bombThe a&h bomb
The a&h bombAli Mas
1K views17 slides
Cementite and associates lab 3 by
Cementite and associates lab 3Cementite and associates lab 3
Cementite and associates lab 3abhamber
298 views18 slides
e-ILP by
e-ILPe-ILP
e-ILPJames Ballard
388 views14 slides
Savannah apartment association leasing & marketing by
Savannah apartment association leasing & marketingSavannah apartment association leasing & marketing
Savannah apartment association leasing & marketingJolene Sopalski
855 views59 slides
Wireless electric system by VEERANNA by
Wireless electric system by VEERANNA Wireless electric system by VEERANNA
Wireless electric system by VEERANNA Bhukya Veeranna
285 views14 slides

Viewers also liked(12)

The a&h bomb by Ali Mas
The a&h bombThe a&h bomb
The a&h bomb
Ali Mas1K views
Cementite and associates lab 3 by abhamber
Cementite and associates lab 3Cementite and associates lab 3
Cementite and associates lab 3
abhamber298 views
Savannah apartment association leasing & marketing by Jolene Sopalski
Savannah apartment association leasing & marketingSavannah apartment association leasing & marketing
Savannah apartment association leasing & marketing
Jolene Sopalski855 views
Wireless electric system by VEERANNA by Bhukya Veeranna
Wireless electric system by VEERANNA Wireless electric system by VEERANNA
Wireless electric system by VEERANNA
Bhukya Veeranna285 views
The king of country by jaclyn by adriennelarry
The king of country by jaclynThe king of country by jaclyn
The king of country by jaclyn
adriennelarry146 views
Recruitment and selection by Nikhit
Recruitment and selectionRecruitment and selection
Recruitment and selection
Nikhit4.6K views
It's all about the small things final by Jolene Sopalski
It's all about the small things finalIt's all about the small things final
It's all about the small things final
Jolene Sopalski314 views

Similar to iOS development - tips & tricks

FI MUNI 2012 - iOS Basics by
FI MUNI 2012 - iOS BasicsFI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS BasicsPetr Dvorak
960 views80 slides
Building security into the pipelines by
Building security into the pipelinesBuilding security into the pipelines
Building security into the pipelinesVandana Verma
159 views38 slides
Capture, record, clip, embed and play, search: video from newbie to ninja by
Capture, record, clip, embed and play, search: video from newbie to ninjaCapture, record, clip, embed and play, search: video from newbie to ninja
Capture, record, clip, embed and play, search: video from newbie to ninjaVito Flavio Lorusso
1.9K views31 slides
Avoiding damage, shame and regrets data protection for mobile client-server a... by
Avoiding damage, shame and regrets data protection for mobile client-server a...Avoiding damage, shame and regrets data protection for mobile client-server a...
Avoiding damage, shame and regrets data protection for mobile client-server a...Stanfy
7.1K views65 slides
OpenStack keystone identity service by
OpenStack keystone identity serviceOpenStack keystone identity service
OpenStack keystone identity serviceopenstackindia
3.2K views15 slides
Serverless DevSecOps: Why We Must Make it Everyone's Problem | Hillel Solow by
Serverless DevSecOps: Why We Must Make it Everyone's Problem | Hillel SolowServerless DevSecOps: Why We Must Make it Everyone's Problem | Hillel Solow
Serverless DevSecOps: Why We Must Make it Everyone's Problem | Hillel SolowAWSCOMSUM
126 views27 slides

Similar to iOS development - tips & tricks(20)

FI MUNI 2012 - iOS Basics by Petr Dvorak
FI MUNI 2012 - iOS BasicsFI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS Basics
Petr Dvorak960 views
Building security into the pipelines by Vandana Verma
Building security into the pipelinesBuilding security into the pipelines
Building security into the pipelines
Vandana Verma159 views
Capture, record, clip, embed and play, search: video from newbie to ninja by Vito Flavio Lorusso
Capture, record, clip, embed and play, search: video from newbie to ninjaCapture, record, clip, embed and play, search: video from newbie to ninja
Capture, record, clip, embed and play, search: video from newbie to ninja
Vito Flavio Lorusso1.9K views
Avoiding damage, shame and regrets data protection for mobile client-server a... by Stanfy
Avoiding damage, shame and regrets data protection for mobile client-server a...Avoiding damage, shame and regrets data protection for mobile client-server a...
Avoiding damage, shame and regrets data protection for mobile client-server a...
Stanfy7.1K views
OpenStack keystone identity service by openstackindia
OpenStack keystone identity serviceOpenStack keystone identity service
OpenStack keystone identity service
openstackindia3.2K views
Serverless DevSecOps: Why We Must Make it Everyone's Problem | Hillel Solow by AWSCOMSUM
Serverless DevSecOps: Why We Must Make it Everyone's Problem | Hillel SolowServerless DevSecOps: Why We Must Make it Everyone's Problem | Hillel Solow
Serverless DevSecOps: Why We Must Make it Everyone's Problem | Hillel Solow
AWSCOMSUM126 views
Automating Security and Compliance Testing of Infrastructure-as-Code for DevS... by Amazon Web Services
Automating Security and Compliance Testing of Infrastructure-as-Code for DevS...Automating Security and Compliance Testing of Infrastructure-as-Code for DevS...
Automating Security and Compliance Testing of Infrastructure-as-Code for DevS...
Amazon Web Services1.6K views
Being a tweaker modern web performance techniques by Chris Love
Being a tweaker   modern web performance techniquesBeing a tweaker   modern web performance techniques
Being a tweaker modern web performance techniques
Chris Love733 views
ZeroNights: Automating iOS blackbox security scanning by Mikhail Sosonkin
ZeroNights: Automating iOS blackbox security scanningZeroNights: Automating iOS blackbox security scanning
ZeroNights: Automating iOS blackbox security scanning
Mikhail Sosonkin1.5K views
Zeronights 2016 - Automating iOS blackbox security scanning by Synack
Zeronights 2016 - Automating iOS blackbox security scanningZeronights 2016 - Automating iOS blackbox security scanning
Zeronights 2016 - Automating iOS blackbox security scanning
Synack2.9K views
MFF UK - Introduction to iOS by Petr Dvorak
MFF UK - Introduction to iOSMFF UK - Introduction to iOS
MFF UK - Introduction to iOS
Petr Dvorak807 views
Positive Technologies - S4 - Scada under x-rays by qqlan
Positive Technologies - S4 - Scada under x-raysPositive Technologies - S4 - Scada under x-rays
Positive Technologies - S4 - Scada under x-rays
qqlan5.7K views
Mobile Security Assessment: 101 by wireharbor
Mobile Security Assessment: 101Mobile Security Assessment: 101
Mobile Security Assessment: 101
wireharbor2.3K views
Testing at Both Ends of the Triangle by Derek Graham
Testing at Both Ends of the TriangleTesting at Both Ends of the Triangle
Testing at Both Ends of the Triangle
Derek Graham41 views
PowerShell: A Language for the Internet of Things #ATLPUG by Taylor Riggan
PowerShell: A Language for the Internet of Things #ATLPUGPowerShell: A Language for the Internet of Things #ATLPUG
PowerShell: A Language for the Internet of Things #ATLPUG
Taylor Riggan451 views
Secure Coding For Java - Une introduction by Sebastien Gioria
Secure Coding For Java - Une introductionSecure Coding For Java - Une introduction
Secure Coding For Java - Une introduction
Sebastien Gioria6.8K views
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5) by Igor Bronovskyy
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
Igor Bronovskyy410 views

Recently uploaded

.NET Deserialization Attacks by
.NET Deserialization Attacks.NET Deserialization Attacks
.NET Deserialization AttacksDharmalingam Ganesan
5 views50 slides
Bootstrapping vs Venture Capital.pptx by
Bootstrapping vs Venture Capital.pptxBootstrapping vs Venture Capital.pptx
Bootstrapping vs Venture Capital.pptxZeljko Svedic
15 views17 slides
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P... by
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...NimaTorabi2
16 views17 slides
What is API by
What is APIWhat is API
What is APIartembondar5
13 views15 slides
Using Qt under LGPL-3.0 by
Using Qt under LGPL-3.0Using Qt under LGPL-3.0
Using Qt under LGPL-3.0Burkhard Stubert
13 views11 slides
Top-5-production-devconMunich-2023.pptx by
Top-5-production-devconMunich-2023.pptxTop-5-production-devconMunich-2023.pptx
Top-5-production-devconMunich-2023.pptxTier1 app
9 views40 slides

Recently uploaded(20)

Bootstrapping vs Venture Capital.pptx by Zeljko Svedic
Bootstrapping vs Venture Capital.pptxBootstrapping vs Venture Capital.pptx
Bootstrapping vs Venture Capital.pptx
Zeljko Svedic15 views
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P... by NimaTorabi2
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...
NimaTorabi216 views
Top-5-production-devconMunich-2023.pptx by Tier1 app
Top-5-production-devconMunich-2023.pptxTop-5-production-devconMunich-2023.pptx
Top-5-production-devconMunich-2023.pptx
Tier1 app9 views
Introduction to Git Source Control by John Valentino
Introduction to Git Source ControlIntroduction to Git Source Control
Introduction to Git Source Control
John Valentino7 views
Navigating container technology for enhanced security by Niklas Saari by Metosin Oy
Navigating container technology for enhanced security by Niklas SaariNavigating container technology for enhanced security by Niklas Saari
Navigating container technology for enhanced security by Niklas Saari
Metosin Oy15 views
Understanding HTML terminology by artembondar5
Understanding HTML terminologyUnderstanding HTML terminology
Understanding HTML terminology
artembondar57 views
Top-5-production-devconMunich-2023-v2.pptx by Tier1 app
Top-5-production-devconMunich-2023-v2.pptxTop-5-production-devconMunich-2023-v2.pptx
Top-5-production-devconMunich-2023-v2.pptx
Tier1 app8 views
ADDO_2022_CICID_Tom_Halpin.pdf by TomHalpin9
ADDO_2022_CICID_Tom_Halpin.pdfADDO_2022_CICID_Tom_Halpin.pdf
ADDO_2022_CICID_Tom_Halpin.pdf
TomHalpin95 views
Electronic AWB - Electronic Air Waybill by Freightoscope
Electronic AWB - Electronic Air Waybill Electronic AWB - Electronic Air Waybill
Electronic AWB - Electronic Air Waybill
Freightoscope 5 views
FOSSLight Community Day 2023-11-30 by Shane Coughlan
FOSSLight Community Day 2023-11-30FOSSLight Community Day 2023-11-30
FOSSLight Community Day 2023-11-30
Shane Coughlan7 views
Dapr Unleashed: Accelerating Microservice Development by Miroslav Janeski
Dapr Unleashed: Accelerating Microservice DevelopmentDapr Unleashed: Accelerating Microservice Development
Dapr Unleashed: Accelerating Microservice Development
Miroslav Janeski15 views

iOS development - tips & tricks

  • 1. iOS Development - Tips & Tricks iOS Development - Tips & Tricks Software Development Lead - iOS Galin Kardzhilov Software Development Manager - iOS Stefan Tsvyatkov
  • 2. iOS Development - Tips & Tricks Agenda  Why iOS  Some challenges  iOS Security
  • 3. iOS Development - Tips & Tricks About Me  Started with
  • 4. iOS Development - Tips & Tricks About Me
  • 5. iOS Development - Tips & Tricks Why iOS? -(NSString *)generateReasonsWhyiOS { NSMutableString *reasons = [[NSMutableString alloc] init]; [reasons appendString:@"It's new"]; [reasons appendString:@"It's challenging"]; [reasons appendString:@"It compiles to native"]; [reasons appendString:@"You have to deal with hardware limitations"]; [reasons appendString:@"You have to provide responsiveness"]; [reasons appendString:@"You have to provide usability"]; [reasons appendString:@"You have to provide security"]; [reasons appendString:@"0ften craftsmanship [reasons appendString:@"Your code runs into people's pockets"]; return reasons; }
  • 6. iOS Development - Tips & Tricks  Table view  Background image  Custom drawn cells … flipped Watch video @ http://youtu.be/Um971SFzOfQ
  • 7. iOS Development - Tips & Tricks Watch video @ http://youtu.be/HrK6PevFYkI
  • 8. iOS Development - Tips & Tricks Scroll View Custom View
  • 9. iOS Development - Tips & Tricks
  • 10. iOS Development - Tips & Tricks Security in iOS  Local Storage  Communication with the server  Binary analysis and manipulation
  • 11. iOS Development - Tips & Tricks Local Storage Security  NSUserDefaults  Convenient  Not encrypted by default  Keeps the data in a plist file  CoreData  Not encrypted by default  Keeps the data in sqlite db Not secure
  • 12. iOS Development - Tips & Tricks Local Storage Security  Keychain Access  Encrypted by default  A bit more complex for use  Insecure on jailbroken devices  Data encryption  Crypto API  Obfuscate the encryption key  Use unique device information String constant [[UIDevice currentDevice] identifierForVendor] Custom algorith Secure encryption
  • 13. iOS Development - Tips & Tricks Server Communication Security  Use SSL  Don’t accept self-signed certificates  Client and server side data validation
  • 14. iOS Development - Tips & Tricks Runtime Manipulation #import "AppDelegate.h" #import "ptrace.h" ! int main(int argc, char * argv[]) { #ifndef DEBUG ptrace(PT_DENY_ATTACH, 0, 0, 0); #endif @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); } }  ptrace  Deny a debugger to attach  Can be patched from binary  Put it in multiple places
  • 15. iOS Development - Tips & Tricks !  SEC_IS_BEING_DEBUGGED_RETURN_NIL() ! ! ! ! ! !  Check if a debugger is attached  Hard to be patched from binary  Make the check regularly and in critical parts  Doesn’t work against Cycript Runtime Manipulation #ifndef DEBUG SEC_IS_BEING_DEBUGGED_RETURN_NIL(); #endif
  • 16. iOS Development - Tips & Tricks Conclusion  Keychain Access for storing  SSL for transporting  Check for debuggers  100% security does not exist
  • 17. iOS Development - Tips & Tricks Thank you! Galin Kardzhilov @gravera Stefan Tsvyatkov @stsvyatkov