17
iOS Development - Tips & Tricks iOS Development - Tips & Tricks Software Development Lead - iOS Galin Kardzhilov Software Development Manager - iOS Stefan Tsvyatkov

iOS development - tips & tricks

Embed Size (px)

Citation preview

Page 1: iOS development - tips & tricks

iOS Development - Tips & Tricks

iOS Development - Tips & Tricks

Software Development Lead - iOSGalin Kardzhilov

Software Development Manager - iOSStefan Tsvyatkov

Page 2: iOS development - tips & tricks

iOS Development - Tips & Tricks

Agenda

Why iOS

Some challenges

iOS Security

Page 3: iOS development - tips & tricks

iOS Development - Tips & Tricks

About Me

Started with

Page 4: iOS development - tips & tricks

iOS Development - Tips & Tricks

About Me

Page 5: iOS development - tips & tricks

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; }

Page 6: iOS development - tips & tricks

iOS Development - Tips & Tricks

Table view

Background image

Custom drawn cells

… flipped

Galin Kardzhilov
Watch video @ http://youtu.be/Um971SFzOfQ
Page 7: iOS development - tips & tricks

iOS Development - Tips & Tricks

Galin Kardzhilov
Watch video @ http://youtu.be/HrK6PevFYkI
Page 8: iOS development - tips & tricks

iOS Development - Tips & Tricks

Scroll View

Custom View

Page 9: iOS development - tips & tricks

iOS Development - Tips & Tricks

Page 10: iOS development - tips & tricks

iOS Development - Tips & Tricks

Security in iOS

Local Storage

Communication with the server

Binary analysis and manipulation

Page 11: iOS development - tips & tricks

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

Page 12: iOS development - tips & tricks

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

Page 13: iOS development - tips & tricks

iOS Development - Tips & Tricks

Server Communication Security

Use SSL

Don’t accept self-signed certificates

Client and server side data validation

Page 14: iOS development - tips & tricks

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

Page 15: iOS development - tips & tricks

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

Page 16: iOS development - tips & tricks

iOS Development - Tips & Tricks

Conclusion

Keychain Access for storing

SSL for transporting

Check for debuggers

100% security does not exist

Page 17: iOS development - tips & tricks

iOS Development - Tips & Tricks

Thank you!

Galin Kardzhilov @graveraStefan Tsvyatkov @stsvyatkov