SlideShare una empresa de Scribd logo
1 de 65
Descargar para leer sin conexión
Avoiding damage,shame and regrets
data protection for mobile
client-server architectures
#doios @vixentael
is intuitive,
evolution trained us for it
Real-world security
Meet Dodo birds!
Alice Bob
data protection for client-server apps #doios @vixentael
They are chatting together
Alice Bob
data protection for client-server apps #doios @vixentael
tweet hello
Here comes Eve..
data protection for client-server apps #doios @vixentael
..the eavesdropping Fennec Fox
Eve eavesdrops
danger
data protection for client-server apps #doios @vixentael
tweet
ack
ear radars: ON 😈
Birds fly away,Eve doesn’t hear them
data protection for client-server apps #doios @vixentael
secure place
hear nothing 😭
Risk (threat): Eve hears your secrets
Mitigation: physically move away
from Eve
Real-world security
evolution did not
prepare you for that!
Cyber-world security
Apple Secure Coding Guide
Every program is a potential target.
Your customers’ property and your reputation
are at stake.
https://developer.apple.com/library/mac/documentation/
Security/Conceptual/SecureCodingGuide/
Introduction.html
data protection for client-server apps #doios @vixentael
What we protect?
User’s data!
data protection for client-server apps #doios @vixentael
in storage
in motion
in memory
Data in motion
There are hackers..
and threats these hackers exploit..
to create damage
data protection for client-server apps #doios @vixentael
Problem: Layer 1
Meet Alice-the-App and Bob-the-Server
Alice-the-App Bob-the-Server
data protection for client-server apps #doios @vixentael
Client and Server are communicating
data protection for client-server apps #doios @vixentael
passw: 123456
HTTP 1.1
Alice-the-App Bob-the-Server
Eve-the-Hacker
data protection for client-server apps #doios @vixentael
Here Eve-the-Hacker comes!
passw: 123456
HTTP 1.1
data protection for client-server apps #doios @vixentael
Here Eve-the-Hacker comes!
passw: 123456
HTTP 1.1
data protection for client-server apps #doios @vixentael
{“passw”:“123456”}
Let’s go deeper..
To avoid threats we need
secure programming
data protection for client-server apps #doios @vixentael
Problem: Layer 2
Alice decides to implement security
data protection for client-server apps #doios @vixentael
puts on paper hat!
Bob decides to implement security
builds the fence!
data protection for client-server apps #doios @vixentael
..and they decide to use HTTPS!
data protection for client-server apps #doios @vixentael
****** : ******
HTTPS 

out of the
box
But it’s not really secure..
****** : ******
HTTPS out ofthe box
data protection for client-server apps #doios @vixentael
{“passw”:“123456”}
Intercept traffic using proxy
data protection for client-server apps #doios @vixentael
* SSL experimenting
with Android Top100
apps
http://bit.ly/1NqpheM
* Intercepting the App
Store's Traffic on iOS
http://bit.ly/1H3xMrs
What helps Eve to eavesdrop?
๏ not encrypting user data
data protection for client-server apps #doios @vixentael
๏ plain HTTP
๏ self-signed certificates
๏ HTTPS with old cipher-suites
๏ using vulnerable libraries and bad examples from
StackOverflow
๏ SSL without SSL certificate pinning
data protection for client-server apps #doios @vixentael
Problem: Layer 3
As the result,
Programming is rarely secure
data protection for client-server apps #doios @vixentael
Software is buggy
http://blog.mindedsecurity.com/2015/03/ssl-mitm-attack-in-afnetworking-251-
do.html
AFNetworking SSL verification bug (v2.5.1-2.5.2)
https://eprint.iacr.org/2013/049.pdf
Out-of-the-box SSL is frequent subject to attacks
http://www.dwheeler.com/essays/apple-goto-fail.html
Apple “goto fail” vulnerability
http://noxxi.de/howto/ssl-debugging.html
๏ Copying bad code from StackOverflow
๏ Debugging by tearing security suites
apart
๏ Avoiding “complicated” security
documentation
data protection for client-server apps #doios @vixentael
Software is buggy.Why?
- is easy to f*ck up
- is inconvenient to implement
Cyber-world security
- use good practice and brain
- use good tools
- minimize re-inventing the wheel
What shall we do?
data protection for client-server apps #doios @vixentael
Realize threat vectors
Bad cryptography
No access control
Authentication bypass
Credential reuse
Session hijacking
Denial of Service
Data leakage
…
Anyone can invent a security system
that he himself cannot break
— Schneier's Law
https://www.schneier.com/blog/archives/
2011/04/schneiers_law.html
data protection for client-server apps #doios @vixentael
Implementing security tools yourself is a threat
Do not re-implement existing things
data protection for client-server apps #doios @vixentael
Use great tools
scientific background trust big guys good track record
data protection for client-server apps #doios @vixentael
libsodium/NaCL
OTRKit
RNCryptor
MIHCrypto
Themis
https://github.com/mochtu/libsodium-ios
https://github.com/ChatSecure/OTRKit
https://github.com/RNCryptor/RNCryptor
https://github.com/hohl/MIHCrypto
https://github.com/cossacklabs/themis
Apple open sourced crypto
data protection for client-server apps #doios @vixentael
Armoring your SSL
Do your SSL/TLS right
๏use long keys
๏disable backward compatibility
๏use strong ciphers (EC vs RSA)
๏pin SSL certificate
๏use cheat sheet
https://www.cossacklabs.com/avoid-ssl-for-your-
next-app.html
SSL has a lot of problems
To survive you need to:
data protection for client-server apps #doios @vixentael
https://www.owasp.org/index.php/
Transport_Layer_Protection_Cheat_Sheet
Do you pin SSL certificate?
data protection for client-server apps #doios @vixentael
SSL/TLS in short
data protection for client-server apps #doios @vixentael
hello
client asks certificate
server sends cert
encrypted data
client verifies cert
- domain,
- expiration date,
- asks CA if cert is valid and not revoked
key negotiation
Where can it break?
data protection for client-server apps #doios @vixentael
hello
client asks certificate
server sends cert
encrypted data
client verifies cert
- domain,
- expiration date,
- asks CA if cert is valid and not revoked
key negotiation
SSL pinning
data protection for client-server apps #doios @vixentael
hello
client asks certificate
server sends cert
encrypted data
client verifies cert
- compares cert against pinned
cert
key negotiation
SSL pinning on iOS
https://possiblemobile.com/2013/03/ssl-pinning-for-increased-app-security/
https://www.paypal-engineering.com/2015/10/14/key-pinning-in-mobile-
applications/
-­‐ (void)connection:(NSURLConnection	
  *)connection	
  
willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge	
  *)challenge	
  {	
  
	
  	
  	
  SecTrustRef	
  serverTrust	
  =	
  challenge.protectionSpace.serverTrust;	
  
	
  	
  	
  id<NSURLAuthenticationChallengeSender>	
  sender	
  =	
  challenge.sender;	
  
	
  	
  	
  SecCertificateRef	
  certificate	
  =	
  SecTrustGetCertificateAtIndex(serverTrust,	
  0);	
  
	
  	
  	
  NSData	
  *	
  remoteCertificateData	
  =	
  
CFBridgingRelease(SecCertificateCopyData(certificate));	
  
	
  	
  	
  
	
  	
  	
  NSString	
  *	
  cerPath	
  =	
  [[NSBundle	
  mainBundle]	
  pathForResource:@"MyLocalCertificate"	
  
ofType:@"cer"];	
  
	
  	
  	
  NSData	
  *	
  localCertData	
  =	
  [NSData	
  dataWithContentsOfFile:cerPath];	
  
	
  	
  	
  if	
  ([remoteCertificateData	
  isEqualToData:localCertData])	
  {	
  
	
  	
  	
  	
  	
  	
  	
  NSURLCredential	
  *	
  credential	
  =	
  [NSURLCredential	
  credentialForTrust:serverTrust];	
  
	
  	
  	
  	
  	
  	
  	
  [sender	
  useCredential:credential	
  forAuthenticationChallenge:challenge];	
  
	
  	
  	
  }	
  else	
  {	
  
	
  	
  	
  	
  	
  	
  	
  [sender	
  cancelAuthenticationChallenge:challenge];	
  
	
  	
  	
  }	
  
}
data protection for client-server apps #doios @vixentael
SSL pinning more easy :)
let	
  certData	
  =	
  NSData(contentsOfFile:	
  
NSBundle.mainBundle().pathForResource("lvwenhancom",	
  ofType:	
  "cer")!)!

...	
  ...	
  
.addSSLPinning(LocalCertData:	
  certData)	
  {	
  ()	
  -­‐>	
  Void	
  in

	
  	
  	
  	
  print("Under	
  Man-­‐in-­‐the-­‐middle	
  attack!")

}
data protection for client-server apps #doios @vixentael
Swift lib for HTTPS and SSL pinning
https://github.com/johnlui/Pitaya
https://github.com/iSECPartners/ssl-conservatory
Nah.
SSL is not enough :(
So,we’re done?
Implementing
Forward Secrecy
Forward Secrecy: Threat
Eve records encrypted
traffic
New crypto vulnerability
allows to exact keys
Eve physically extracts keys
from one of the birds
Eve decrypts all encrypted
traffic
data protection for client-server apps #doios @vixentael
Forward Secrecy: Mitigation
Forward Secrecy
ephemeral keys + key rotation scheme
data protection for client-server apps #doios @vixentael
https://weakdh.org/imperfect-forward-secrecy-ccs15.pdf
SSL/TLS has forward secrecy but it’s weak:
=
Using ephemeral key
data protection for client-server apps #doios @vixentael
key negotiation (RSA or EC)
create symmetric temp key
use temp key to
encrypt messages
during session
close session
open session
Implementing ephemeral keys
1. establish session
2. encrypt message with SecureSession before sending
3. decrypt message after receive
4. encrypt history with SecureCell
data protection for client-server apps #doios @vixentael
https://github.com/cossacklabs/themis
Themis has built-in forward secrecy inside
SecureSession object
Implementing ephemeral keys
data protection for client-server apps #doios @vixentael
https://github.com/cossacklabs/mobile-websocket-example
Data in storage
What we need to do
1. Choose good storage library with
efficient crypto
2. Embed it on read/write
3. Store keys safely
data protection for client-server apps #doios @vixentael
RNCryptor example
Themis SecureCell example
data protection for client-server apps #doios @vixentael
Storage libraries
data protection for client-server apps #doios @vixentael
Storing the keys
SSKeychain example
Valet example
https://github.com/square/Valet
https://github.com/soffes/sskeychain
compute key and use KDF to derive
data protection for client-server apps #doios @vixentael
Storing the keys: Computable obfuscation
https://www.mikeash.com/pyblog/friday-qa-2012-08-10-a-tour-of-
commoncrypto.html
key = KDF(sqrt(42)*len(user_id)/parity(user_id))
Ending notes
Practical app security step by step
1.Use HTTPS with good TLS settings
2.Enable SSL pinning
3.Encrypt user data in motion with ephemeral keys
4.Encrypt stored data and protect the key
data protection for client-server apps #doios @vixentael
Alice is more secure now
data protection for client-server apps #doios @vixentael
SSL pinning
encrypted 

storage data
ephemeral keys
Bob is more secure now
data protection for client-server apps #doios @vixentael
encrypted 

storage data
ephemeral keys
Chatting is more secure
5720b3c2 fe674f54
73e10ad4 ...
HTTPS
SSL pinning
ephemeral keys
data protection for client-server apps #doios @vixentael
Security is full of
adventures and
discoveries.
And fun.
andshinymetalbirds!
The last slide
@vixentael iOS developer
at stanfy.com
[creating awesome mobile
and IoT apps]
data protection for client-server apps #doios @vixentael
take
care!
More to read
★ The Mobile Application Hacker's Handbook
https://books.google.com.ua/books?id=UgVhBgAAQBAJ
★ Designing Secure User Interfaces
https://developer.apple.com/library/ios/documentation/Security/
Conceptual/SecureCodingGuide/Articles/AppInterfaces.html#//apple_ref/
doc/uid/TP40002862-SW1
★ CryptoCat iOS app security audit
https://nabla-c0d3.github.io/documents/iSEC_Cryptocat_iOS.pdf
★ Storing secret keys
http://www.splinter.com.au/2014/09/16/storing-secret-keys/
More to watch
★ All talks of Moxie Marlinspike
https://www.youtube.com/watch?v=ibF36Yyeehw
https://www.youtube.com/watch?v=8N4sb-SEpcg
https://www.youtube.com/watch?v=tOMiAeRwpPA

Más contenido relacionado

La actualidad más candente

Safety first – best practices in app security​
Safety first – best practices in app security​Safety first – best practices in app security​
Safety first – best practices in app security​Ana Baotić
 
Owasp Mobile Risk Series : M3 : Insufficient Transport Layer Protection
Owasp Mobile Risk Series : M3 : Insufficient Transport Layer ProtectionOwasp Mobile Risk Series : M3 : Insufficient Transport Layer Protection
Owasp Mobile Risk Series : M3 : Insufficient Transport Layer ProtectionAnant Shrivastava
 
Lock That Shit Down! Auth Security Patterns for Apps, APIs, and Infra - Sprin...
Lock That Shit Down! Auth Security Patterns for Apps, APIs, and Infra - Sprin...Lock That Shit Down! Auth Security Patterns for Apps, APIs, and Infra - Sprin...
Lock That Shit Down! Auth Security Patterns for Apps, APIs, and Infra - Sprin...Matt Raible
 
Securing your EmberJS Application
Securing your EmberJS ApplicationSecuring your EmberJS Application
Securing your EmberJS ApplicationPhilippe De Ryck
 
Перевірка роботи McAfee ENS. MVISION Insights SUNBURST.
Перевірка роботи McAfee ENS. MVISION Insights SUNBURST.Перевірка роботи McAfee ENS. MVISION Insights SUNBURST.
Перевірка роботи McAfee ENS. MVISION Insights SUNBURST.Vladyslav Radetsky
 
DevOops Redux Ken Johnson Chris Gates - AppSec USA 2016
DevOops Redux Ken Johnson Chris Gates  - AppSec USA 2016DevOops Redux Ken Johnson Chris Gates  - AppSec USA 2016
DevOops Redux Ken Johnson Chris Gates - AppSec USA 2016Chris Gates
 
Automated Infrastructure Security: Monitoring using FOSS
Automated Infrastructure Security: Monitoring using FOSSAutomated Infrastructure Security: Monitoring using FOSS
Automated Infrastructure Security: Monitoring using FOSSSonatype
 
JHipster and Okta - JHipster Virtual Meetup December 2020
JHipster and Okta - JHipster Virtual Meetup December 2020JHipster and Okta - JHipster Virtual Meetup December 2020
JHipster and Okta - JHipster Virtual Meetup December 2020Matt Raible
 
Hardening Your Config Management - Security and Attack Vectors in Config Mana...
Hardening Your Config Management - Security and Attack Vectors in Config Mana...Hardening Your Config Management - Security and Attack Vectors in Config Mana...
Hardening Your Config Management - Security and Attack Vectors in Config Mana...Peter Souter
 
Are you botching the security of your AngularJS applications? (DevFest 2016)
Are you botching the security of your AngularJS applications? (DevFest 2016)Are you botching the security of your AngularJS applications? (DevFest 2016)
Are you botching the security of your AngularJS applications? (DevFest 2016)Philippe De Ryck
 
Prepare to defend thyself with Blue/Green
Prepare to defend thyself with Blue/GreenPrepare to defend thyself with Blue/Green
Prepare to defend thyself with Blue/GreenSonatype
 
Vault and Security as a Service
Vault and Security as a ServiceVault and Security as a Service
Vault and Security as a ServicePatrick Shields
 
[OWASP Poland Day] Saving private token
[OWASP Poland Day] Saving private token[OWASP Poland Day] Saving private token
[OWASP Poland Day] Saving private tokenOWASP
 
Streamline CI/CD with Just-in-Time Access
Streamline CI/CD with Just-in-Time AccessStreamline CI/CD with Just-in-Time Access
Streamline CI/CD with Just-in-Time AccessAkeyless
 
Choose Your Own Adventure with JHipster & Kubernetes - Utah JUG 2020
Choose Your Own Adventure with JHipster & Kubernetes - Utah JUG 2020Choose Your Own Adventure with JHipster & Kubernetes - Utah JUG 2020
Choose Your Own Adventure with JHipster & Kubernetes - Utah JUG 2020Matt Raible
 
REST API Pentester's perspective
REST API Pentester's perspectiveREST API Pentester's perspective
REST API Pentester's perspectiveSecuRing
 
Anastasia Vixentael - Don't Waste Time on Learning Cryptography: Better Use I...
Anastasia Vixentael - Don't Waste Time on Learning Cryptography: Better Use I...Anastasia Vixentael - Don't Waste Time on Learning Cryptography: Better Use I...
Anastasia Vixentael - Don't Waste Time on Learning Cryptography: Better Use I...OWASP Kyiv
 
Basic detection tests of McAfee ENS + MVISION Insights usage for SunBurst threat
Basic detection tests of McAfee ENS + MVISION Insights usage for SunBurst threatBasic detection tests of McAfee ENS + MVISION Insights usage for SunBurst threat
Basic detection tests of McAfee ENS + MVISION Insights usage for SunBurst threatVladyslav Radetsky
 
BlueHat v17 || Down the Open Source Software Rabbit Hole
BlueHat v17 || Down the Open Source Software Rabbit Hole BlueHat v17 || Down the Open Source Software Rabbit Hole
BlueHat v17 || Down the Open Source Software Rabbit Hole BlueHat Security Conference
 

La actualidad más candente (20)

Safety first – best practices in app security​
Safety first – best practices in app security​Safety first – best practices in app security​
Safety first – best practices in app security​
 
Owasp Mobile Risk Series : M3 : Insufficient Transport Layer Protection
Owasp Mobile Risk Series : M3 : Insufficient Transport Layer ProtectionOwasp Mobile Risk Series : M3 : Insufficient Transport Layer Protection
Owasp Mobile Risk Series : M3 : Insufficient Transport Layer Protection
 
Certificate Pinning: Not as Simple as It Sounds
Certificate Pinning: Not as Simple as It Sounds Certificate Pinning: Not as Simple as It Sounds
Certificate Pinning: Not as Simple as It Sounds
 
Lock That Shit Down! Auth Security Patterns for Apps, APIs, and Infra - Sprin...
Lock That Shit Down! Auth Security Patterns for Apps, APIs, and Infra - Sprin...Lock That Shit Down! Auth Security Patterns for Apps, APIs, and Infra - Sprin...
Lock That Shit Down! Auth Security Patterns for Apps, APIs, and Infra - Sprin...
 
Securing your EmberJS Application
Securing your EmberJS ApplicationSecuring your EmberJS Application
Securing your EmberJS Application
 
Перевірка роботи McAfee ENS. MVISION Insights SUNBURST.
Перевірка роботи McAfee ENS. MVISION Insights SUNBURST.Перевірка роботи McAfee ENS. MVISION Insights SUNBURST.
Перевірка роботи McAfee ENS. MVISION Insights SUNBURST.
 
DevOops Redux Ken Johnson Chris Gates - AppSec USA 2016
DevOops Redux Ken Johnson Chris Gates  - AppSec USA 2016DevOops Redux Ken Johnson Chris Gates  - AppSec USA 2016
DevOops Redux Ken Johnson Chris Gates - AppSec USA 2016
 
Automated Infrastructure Security: Monitoring using FOSS
Automated Infrastructure Security: Monitoring using FOSSAutomated Infrastructure Security: Monitoring using FOSS
Automated Infrastructure Security: Monitoring using FOSS
 
JHipster and Okta - JHipster Virtual Meetup December 2020
JHipster and Okta - JHipster Virtual Meetup December 2020JHipster and Okta - JHipster Virtual Meetup December 2020
JHipster and Okta - JHipster Virtual Meetup December 2020
 
Hardening Your Config Management - Security and Attack Vectors in Config Mana...
Hardening Your Config Management - Security and Attack Vectors in Config Mana...Hardening Your Config Management - Security and Attack Vectors in Config Mana...
Hardening Your Config Management - Security and Attack Vectors in Config Mana...
 
Are you botching the security of your AngularJS applications? (DevFest 2016)
Are you botching the security of your AngularJS applications? (DevFest 2016)Are you botching the security of your AngularJS applications? (DevFest 2016)
Are you botching the security of your AngularJS applications? (DevFest 2016)
 
Prepare to defend thyself with Blue/Green
Prepare to defend thyself with Blue/GreenPrepare to defend thyself with Blue/Green
Prepare to defend thyself with Blue/Green
 
Vault and Security as a Service
Vault and Security as a ServiceVault and Security as a Service
Vault and Security as a Service
 
[OWASP Poland Day] Saving private token
[OWASP Poland Day] Saving private token[OWASP Poland Day] Saving private token
[OWASP Poland Day] Saving private token
 
Streamline CI/CD with Just-in-Time Access
Streamline CI/CD with Just-in-Time AccessStreamline CI/CD with Just-in-Time Access
Streamline CI/CD with Just-in-Time Access
 
Choose Your Own Adventure with JHipster & Kubernetes - Utah JUG 2020
Choose Your Own Adventure with JHipster & Kubernetes - Utah JUG 2020Choose Your Own Adventure with JHipster & Kubernetes - Utah JUG 2020
Choose Your Own Adventure with JHipster & Kubernetes - Utah JUG 2020
 
REST API Pentester's perspective
REST API Pentester's perspectiveREST API Pentester's perspective
REST API Pentester's perspective
 
Anastasia Vixentael - Don't Waste Time on Learning Cryptography: Better Use I...
Anastasia Vixentael - Don't Waste Time on Learning Cryptography: Better Use I...Anastasia Vixentael - Don't Waste Time on Learning Cryptography: Better Use I...
Anastasia Vixentael - Don't Waste Time on Learning Cryptography: Better Use I...
 
Basic detection tests of McAfee ENS + MVISION Insights usage for SunBurst threat
Basic detection tests of McAfee ENS + MVISION Insights usage for SunBurst threatBasic detection tests of McAfee ENS + MVISION Insights usage for SunBurst threat
Basic detection tests of McAfee ENS + MVISION Insights usage for SunBurst threat
 
BlueHat v17 || Down the Open Source Software Rabbit Hole
BlueHat v17 || Down the Open Source Software Rabbit Hole BlueHat v17 || Down the Open Source Software Rabbit Hole
BlueHat v17 || Down the Open Source Software Rabbit Hole
 

Destacado

Building Profanity Filters: clbuttic sh!t
Building Profanity Filters: clbuttic sh!tBuilding Profanity Filters: clbuttic sh!t
Building Profanity Filters: clbuttic sh!tStanfy
 
Data transfer security for mobile apps
Data transfer security for mobile appsData transfer security for mobile apps
Data transfer security for mobile appsStanfy
 
Polymorphic Attacks on Data-in-Motion Require a New Security Approach From Bo...
Polymorphic Attacks on Data-in-Motion Require a New Security Approach From Bo...Polymorphic Attacks on Data-in-Motion Require a New Security Approach From Bo...
Polymorphic Attacks on Data-in-Motion Require a New Security Approach From Bo...ADVA
 
Users' Data Security in iOS Applications
Users' Data Security in iOS ApplicationsUsers' Data Security in iOS Applications
Users' Data Security in iOS ApplicationsStanfy
 
Android Developer Days: Increasing performance of big arrays processing on An...
Android Developer Days: Increasing performance of big arrays processing on An...Android Developer Days: Increasing performance of big arrays processing on An...
Android Developer Days: Increasing performance of big arrays processing on An...Stanfy
 
Data processing components architecture in mobile applications
Data processing components architecture in mobile applicationsData processing components architecture in mobile applications
Data processing components architecture in mobile applicationsStanfy
 
Oauth2 and OWSM OAuth2 support
Oauth2 and OWSM OAuth2 supportOauth2 and OWSM OAuth2 support
Oauth2 and OWSM OAuth2 supportGaurav Sharma
 
Acwa AEROHIVE CONFIGURATION GIUDE.
Acwa AEROHIVE CONFIGURATION GIUDE. Acwa AEROHIVE CONFIGURATION GIUDE.
Acwa AEROHIVE CONFIGURATION GIUDE. armaan7139
 
Fitness In Mobile: A Case Study.
Fitness In Mobile: A Case Study. Fitness In Mobile: A Case Study.
Fitness In Mobile: A Case Study. Stanfy
 
Protocol-Oriented MVVM (extended edition)
Protocol-Oriented MVVM (extended edition)Protocol-Oriented MVVM (extended edition)
Protocol-Oriented MVVM (extended edition)Natasha Murashev
 
architecture of mobile software applications
architecture of mobile software applicationsarchitecture of mobile software applications
architecture of mobile software applicationsHassan Dar
 
OAuth 2.0 and Mobile Devices: Is that a token in your phone in your pocket or...
OAuth 2.0 and Mobile Devices: Is that a token in your phone in your pocket or...OAuth 2.0 and Mobile Devices: Is that a token in your phone in your pocket or...
OAuth 2.0 and Mobile Devices: Is that a token in your phone in your pocket or...Brian Campbell
 

Destacado (12)

Building Profanity Filters: clbuttic sh!t
Building Profanity Filters: clbuttic sh!tBuilding Profanity Filters: clbuttic sh!t
Building Profanity Filters: clbuttic sh!t
 
Data transfer security for mobile apps
Data transfer security for mobile appsData transfer security for mobile apps
Data transfer security for mobile apps
 
Polymorphic Attacks on Data-in-Motion Require a New Security Approach From Bo...
Polymorphic Attacks on Data-in-Motion Require a New Security Approach From Bo...Polymorphic Attacks on Data-in-Motion Require a New Security Approach From Bo...
Polymorphic Attacks on Data-in-Motion Require a New Security Approach From Bo...
 
Users' Data Security in iOS Applications
Users' Data Security in iOS ApplicationsUsers' Data Security in iOS Applications
Users' Data Security in iOS Applications
 
Android Developer Days: Increasing performance of big arrays processing on An...
Android Developer Days: Increasing performance of big arrays processing on An...Android Developer Days: Increasing performance of big arrays processing on An...
Android Developer Days: Increasing performance of big arrays processing on An...
 
Data processing components architecture in mobile applications
Data processing components architecture in mobile applicationsData processing components architecture in mobile applications
Data processing components architecture in mobile applications
 
Oauth2 and OWSM OAuth2 support
Oauth2 and OWSM OAuth2 supportOauth2 and OWSM OAuth2 support
Oauth2 and OWSM OAuth2 support
 
Acwa AEROHIVE CONFIGURATION GIUDE.
Acwa AEROHIVE CONFIGURATION GIUDE. Acwa AEROHIVE CONFIGURATION GIUDE.
Acwa AEROHIVE CONFIGURATION GIUDE.
 
Fitness In Mobile: A Case Study.
Fitness In Mobile: A Case Study. Fitness In Mobile: A Case Study.
Fitness In Mobile: A Case Study.
 
Protocol-Oriented MVVM (extended edition)
Protocol-Oriented MVVM (extended edition)Protocol-Oriented MVVM (extended edition)
Protocol-Oriented MVVM (extended edition)
 
architecture of mobile software applications
architecture of mobile software applicationsarchitecture of mobile software applications
architecture of mobile software applications
 
OAuth 2.0 and Mobile Devices: Is that a token in your phone in your pocket or...
OAuth 2.0 and Mobile Devices: Is that a token in your phone in your pocket or...OAuth 2.0 and Mobile Devices: Is that a token in your phone in your pocket or...
OAuth 2.0 and Mobile Devices: Is that a token in your phone in your pocket or...
 

Similar a Avoiding damage, shame and regrets data protection for mobile client-server architectures

Magento Application Security [EN]
Magento Application Security [EN]Magento Application Security [EN]
Magento Application Security [EN]Anna Völkl
 
Case Studies and Lessons Learned from SSL/TLS Certificate Verification Vulner...
Case Studies and Lessons Learned from SSL/TLS Certificate Verification Vulner...Case Studies and Lessons Learned from SSL/TLS Certificate Verification Vulner...
Case Studies and Lessons Learned from SSL/TLS Certificate Verification Vulner...JPCERT Coordination Center
 
"Crypto wallets security. For developers", Julia Potapenko
"Crypto wallets security. For developers", Julia Potapenko"Crypto wallets security. For developers", Julia Potapenko
"Crypto wallets security. For developers", Julia PotapenkoFwdays
 
CommCon 2023 - WebRTC & Video Delivery application security - what could poss...
CommCon 2023 - WebRTC & Video Delivery application security - what could poss...CommCon 2023 - WebRTC & Video Delivery application security - what could poss...
CommCon 2023 - WebRTC & Video Delivery application security - what could poss...Sandro Gauci
 
Security in the cloud protecting your cloud apps
Security in the cloud   protecting your cloud appsSecurity in the cloud   protecting your cloud apps
Security in the cloud protecting your cloud appsCenzic
 
Secure socket layer
Secure socket layerSecure socket layer
Secure socket layerBU
 
LibreSSL, one year later
LibreSSL, one year laterLibreSSL, one year later
LibreSSL, one year laterGiovanni Bechis
 
Top 10 Security Concerns of Windows Mobile (and how to Overcome them)
Top 10 Security Concerns of Windows Mobile (and how to Overcome them)Top 10 Security Concerns of Windows Mobile (and how to Overcome them)
Top 10 Security Concerns of Windows Mobile (and how to Overcome them)jasonlan
 
Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design
Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by DesignJon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design
Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Designjonmccoy
 
The Four Horsemen of Mobile Security
The Four Horsemen of Mobile SecurityThe Four Horsemen of Mobile Security
The Four Horsemen of Mobile SecuritySkycure
 
Web security programming_ii
Web security programming_iiWeb security programming_ii
Web security programming_iigoogli
 
Web Security Programming I I
Web  Security  Programming  I IWeb  Security  Programming  I I
Web Security Programming I IPavu Jas
 
Web security programming_ii
Web security programming_iiWeb security programming_ii
Web security programming_iigoogli
 
Security Theatre - PHP UK Conference
Security Theatre - PHP UK ConferenceSecurity Theatre - PHP UK Conference
Security Theatre - PHP UK Conferencexsist10
 
The Emergent Cloud Security Toolchain for CI/CD
The Emergent Cloud Security Toolchain for CI/CDThe Emergent Cloud Security Toolchain for CI/CD
The Emergent Cloud Security Toolchain for CI/CDJames Wickett
 
IRJET- Cloud Computing with Encryption
IRJET-  	  Cloud Computing with EncryptionIRJET-  	  Cloud Computing with Encryption
IRJET- Cloud Computing with EncryptionIRJET Journal
 
The Safest Way To Interact Online
The Safest Way To Interact OnlineThe Safest Way To Interact Online
The Safest Way To Interact Onlinepcsafe
 
Secure Your Mobile Apps
Secure Your Mobile AppsSecure Your Mobile Apps
Secure Your Mobile Appsprimomh
 
FBI & Secret Service- Business Email Compromise Workshop
FBI & Secret Service- Business Email Compromise WorkshopFBI & Secret Service- Business Email Compromise Workshop
FBI & Secret Service- Business Email Compromise WorkshopErnest Staats
 

Similar a Avoiding damage, shame and regrets data protection for mobile client-server architectures (20)

Magento Application Security [EN]
Magento Application Security [EN]Magento Application Security [EN]
Magento Application Security [EN]
 
Case Studies and Lessons Learned from SSL/TLS Certificate Verification Vulner...
Case Studies and Lessons Learned from SSL/TLS Certificate Verification Vulner...Case Studies and Lessons Learned from SSL/TLS Certificate Verification Vulner...
Case Studies and Lessons Learned from SSL/TLS Certificate Verification Vulner...
 
"Crypto wallets security. For developers", Julia Potapenko
"Crypto wallets security. For developers", Julia Potapenko"Crypto wallets security. For developers", Julia Potapenko
"Crypto wallets security. For developers", Julia Potapenko
 
CommCon 2023 - WebRTC & Video Delivery application security - what could poss...
CommCon 2023 - WebRTC & Video Delivery application security - what could poss...CommCon 2023 - WebRTC & Video Delivery application security - what could poss...
CommCon 2023 - WebRTC & Video Delivery application security - what could poss...
 
Security in the cloud protecting your cloud apps
Security in the cloud   protecting your cloud appsSecurity in the cloud   protecting your cloud apps
Security in the cloud protecting your cloud apps
 
Secure socket layer
Secure socket layerSecure socket layer
Secure socket layer
 
LibreSSL, one year later
LibreSSL, one year laterLibreSSL, one year later
LibreSSL, one year later
 
Top 10 Security Concerns of Windows Mobile (and how to Overcome them)
Top 10 Security Concerns of Windows Mobile (and how to Overcome them)Top 10 Security Concerns of Windows Mobile (and how to Overcome them)
Top 10 Security Concerns of Windows Mobile (and how to Overcome them)
 
Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design
Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by DesignJon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design
Jon McCoy - AppSec-USA-2014 Hacking C#(.NET) Applications:Defend by Design
 
The Four Horsemen of Mobile Security
The Four Horsemen of Mobile SecurityThe Four Horsemen of Mobile Security
The Four Horsemen of Mobile Security
 
demo1
demo1demo1
demo1
 
Web security programming_ii
Web security programming_iiWeb security programming_ii
Web security programming_ii
 
Web Security Programming I I
Web  Security  Programming  I IWeb  Security  Programming  I I
Web Security Programming I I
 
Web security programming_ii
Web security programming_iiWeb security programming_ii
Web security programming_ii
 
Security Theatre - PHP UK Conference
Security Theatre - PHP UK ConferenceSecurity Theatre - PHP UK Conference
Security Theatre - PHP UK Conference
 
The Emergent Cloud Security Toolchain for CI/CD
The Emergent Cloud Security Toolchain for CI/CDThe Emergent Cloud Security Toolchain for CI/CD
The Emergent Cloud Security Toolchain for CI/CD
 
IRJET- Cloud Computing with Encryption
IRJET-  	  Cloud Computing with EncryptionIRJET-  	  Cloud Computing with Encryption
IRJET- Cloud Computing with Encryption
 
The Safest Way To Interact Online
The Safest Way To Interact OnlineThe Safest Way To Interact Online
The Safest Way To Interact Online
 
Secure Your Mobile Apps
Secure Your Mobile AppsSecure Your Mobile Apps
Secure Your Mobile Apps
 
FBI & Secret Service- Business Email Compromise Workshop
FBI & Secret Service- Business Email Compromise WorkshopFBI & Secret Service- Business Email Compromise Workshop
FBI & Secret Service- Business Email Compromise Workshop
 

Más de Stanfy

Stanfy MadCode Meetup #11: Why do you need to switch from Obj-C to Swift, or ...
Stanfy MadCode Meetup #11: Why do you need to switch from Obj-C to Swift, or ...Stanfy MadCode Meetup #11: Why do you need to switch from Obj-C to Swift, or ...
Stanfy MadCode Meetup #11: Why do you need to switch from Obj-C to Swift, or ...Stanfy
 
Stanfy MadCode Meetup #9: Functional Programming 101 with Swift
Stanfy MadCode Meetup #9: Functional Programming 101 with SwiftStanfy MadCode Meetup #9: Functional Programming 101 with Swift
Stanfy MadCode Meetup #9: Functional Programming 101 with SwiftStanfy
 
Optimistic Approach. How to show results instead spinners without breaking yo...
Optimistic Approach. How to show results instead spinners without breaking yo...Optimistic Approach. How to show results instead spinners without breaking yo...
Optimistic Approach. How to show results instead spinners without breaking yo...Stanfy
 
ComponenKit and React Native
ComponenKit and React NativeComponenKit and React Native
ComponenKit and React NativeStanfy
 
UX Research in mobile
UX Research in mobileUX Research in mobile
UX Research in mobileStanfy
 
Remote user research & usability methods
Remote user research & usability methodsRemote user research & usability methods
Remote user research & usability methodsStanfy
 
Stanfy MadCode Meetup#6: Apple Watch. First Steps.
Stanfy MadCode Meetup#6: Apple Watch. First Steps.Stanfy MadCode Meetup#6: Apple Watch. First Steps.
Stanfy MadCode Meetup#6: Apple Watch. First Steps.Stanfy
 
Stanfy MadCode Meetup: Анализ и модификация HTTP запросов для тестирования мо...
Stanfy MadCode Meetup: Анализ и модификация HTTP запросов для тестирования мо...Stanfy MadCode Meetup: Анализ и модификация HTTP запросов для тестирования мо...
Stanfy MadCode Meetup: Анализ и модификация HTTP запросов для тестирования мо...Stanfy
 
Stanfy's highlights of 2013
Stanfy's highlights of 2013Stanfy's highlights of 2013
Stanfy's highlights of 2013Stanfy
 
10 things to consider when choosing a mobile platform (iOS or Android)
10 things to consider when choosing a mobile platform (iOS or Android)10 things to consider when choosing a mobile platform (iOS or Android)
10 things to consider when choosing a mobile platform (iOS or Android)Stanfy
 
Stanfy Publications: How to Conduct Quick Usability Tests for iOS & Android A...
Stanfy Publications: How to Conduct Quick Usability Tests for iOS & Android A...Stanfy Publications: How to Conduct Quick Usability Tests for iOS & Android A...
Stanfy Publications: How to Conduct Quick Usability Tests for iOS & Android A...Stanfy
 
Stanfy Publications: Mobile Applications UI/UX Prototyping Process
Stanfy Publications: Mobile Applications UI/UX Prototyping ProcessStanfy Publications: Mobile Applications UI/UX Prototyping Process
Stanfy Publications: Mobile Applications UI/UX Prototyping ProcessStanfy
 
Stanfy Publications: Successful Cases of Mobile Technology in Medical Industry
Stanfy Publications: Successful Cases of Mobile Technology in Medical Industry Stanfy Publications: Successful Cases of Mobile Technology in Medical Industry
Stanfy Publications: Successful Cases of Mobile Technology in Medical Industry Stanfy
 

Más de Stanfy (13)

Stanfy MadCode Meetup #11: Why do you need to switch from Obj-C to Swift, or ...
Stanfy MadCode Meetup #11: Why do you need to switch from Obj-C to Swift, or ...Stanfy MadCode Meetup #11: Why do you need to switch from Obj-C to Swift, or ...
Stanfy MadCode Meetup #11: Why do you need to switch from Obj-C to Swift, or ...
 
Stanfy MadCode Meetup #9: Functional Programming 101 with Swift
Stanfy MadCode Meetup #9: Functional Programming 101 with SwiftStanfy MadCode Meetup #9: Functional Programming 101 with Swift
Stanfy MadCode Meetup #9: Functional Programming 101 with Swift
 
Optimistic Approach. How to show results instead spinners without breaking yo...
Optimistic Approach. How to show results instead spinners without breaking yo...Optimistic Approach. How to show results instead spinners without breaking yo...
Optimistic Approach. How to show results instead spinners without breaking yo...
 
ComponenKit and React Native
ComponenKit and React NativeComponenKit and React Native
ComponenKit and React Native
 
UX Research in mobile
UX Research in mobileUX Research in mobile
UX Research in mobile
 
Remote user research & usability methods
Remote user research & usability methodsRemote user research & usability methods
Remote user research & usability methods
 
Stanfy MadCode Meetup#6: Apple Watch. First Steps.
Stanfy MadCode Meetup#6: Apple Watch. First Steps.Stanfy MadCode Meetup#6: Apple Watch. First Steps.
Stanfy MadCode Meetup#6: Apple Watch. First Steps.
 
Stanfy MadCode Meetup: Анализ и модификация HTTP запросов для тестирования мо...
Stanfy MadCode Meetup: Анализ и модификация HTTP запросов для тестирования мо...Stanfy MadCode Meetup: Анализ и модификация HTTP запросов для тестирования мо...
Stanfy MadCode Meetup: Анализ и модификация HTTP запросов для тестирования мо...
 
Stanfy's highlights of 2013
Stanfy's highlights of 2013Stanfy's highlights of 2013
Stanfy's highlights of 2013
 
10 things to consider when choosing a mobile platform (iOS or Android)
10 things to consider when choosing a mobile platform (iOS or Android)10 things to consider when choosing a mobile platform (iOS or Android)
10 things to consider when choosing a mobile platform (iOS or Android)
 
Stanfy Publications: How to Conduct Quick Usability Tests for iOS & Android A...
Stanfy Publications: How to Conduct Quick Usability Tests for iOS & Android A...Stanfy Publications: How to Conduct Quick Usability Tests for iOS & Android A...
Stanfy Publications: How to Conduct Quick Usability Tests for iOS & Android A...
 
Stanfy Publications: Mobile Applications UI/UX Prototyping Process
Stanfy Publications: Mobile Applications UI/UX Prototyping ProcessStanfy Publications: Mobile Applications UI/UX Prototyping Process
Stanfy Publications: Mobile Applications UI/UX Prototyping Process
 
Stanfy Publications: Successful Cases of Mobile Technology in Medical Industry
Stanfy Publications: Successful Cases of Mobile Technology in Medical Industry Stanfy Publications: Successful Cases of Mobile Technology in Medical Industry
Stanfy Publications: Successful Cases of Mobile Technology in Medical Industry
 

Avoiding damage, shame and regrets data protection for mobile client-server architectures

  • 1. Avoiding damage,shame and regrets data protection for mobile client-server architectures #doios @vixentael
  • 2. is intuitive, evolution trained us for it Real-world security
  • 3. Meet Dodo birds! Alice Bob data protection for client-server apps #doios @vixentael
  • 4. They are chatting together Alice Bob data protection for client-server apps #doios @vixentael tweet hello
  • 5. Here comes Eve.. data protection for client-server apps #doios @vixentael ..the eavesdropping Fennec Fox
  • 6. Eve eavesdrops danger data protection for client-server apps #doios @vixentael tweet ack ear radars: ON 😈
  • 7. Birds fly away,Eve doesn’t hear them data protection for client-server apps #doios @vixentael secure place hear nothing 😭
  • 8. Risk (threat): Eve hears your secrets Mitigation: physically move away from Eve Real-world security
  • 9. evolution did not prepare you for that! Cyber-world security
  • 10. Apple Secure Coding Guide Every program is a potential target. Your customers’ property and your reputation are at stake. https://developer.apple.com/library/mac/documentation/ Security/Conceptual/SecureCodingGuide/ Introduction.html data protection for client-server apps #doios @vixentael
  • 11. What we protect? User’s data! data protection for client-server apps #doios @vixentael in storage in motion in memory
  • 13. There are hackers.. and threats these hackers exploit.. to create damage data protection for client-server apps #doios @vixentael Problem: Layer 1
  • 14. Meet Alice-the-App and Bob-the-Server Alice-the-App Bob-the-Server data protection for client-server apps #doios @vixentael
  • 15. Client and Server are communicating data protection for client-server apps #doios @vixentael passw: 123456 HTTP 1.1 Alice-the-App Bob-the-Server
  • 16. Eve-the-Hacker data protection for client-server apps #doios @vixentael
  • 17. Here Eve-the-Hacker comes! passw: 123456 HTTP 1.1 data protection for client-server apps #doios @vixentael
  • 18. Here Eve-the-Hacker comes! passw: 123456 HTTP 1.1 data protection for client-server apps #doios @vixentael {“passw”:“123456”}
  • 19. Let’s go deeper.. To avoid threats we need secure programming data protection for client-server apps #doios @vixentael Problem: Layer 2
  • 20. Alice decides to implement security data protection for client-server apps #doios @vixentael puts on paper hat!
  • 21. Bob decides to implement security builds the fence! data protection for client-server apps #doios @vixentael
  • 22. ..and they decide to use HTTPS! data protection for client-server apps #doios @vixentael ****** : ****** HTTPS out of the box
  • 23. But it’s not really secure.. ****** : ****** HTTPS out ofthe box data protection for client-server apps #doios @vixentael {“passw”:“123456”}
  • 24. Intercept traffic using proxy data protection for client-server apps #doios @vixentael * SSL experimenting with Android Top100 apps http://bit.ly/1NqpheM * Intercepting the App Store's Traffic on iOS http://bit.ly/1H3xMrs
  • 25. What helps Eve to eavesdrop? ๏ not encrypting user data data protection for client-server apps #doios @vixentael ๏ plain HTTP ๏ self-signed certificates ๏ HTTPS with old cipher-suites ๏ using vulnerable libraries and bad examples from StackOverflow ๏ SSL without SSL certificate pinning
  • 26. data protection for client-server apps #doios @vixentael Problem: Layer 3 As the result, Programming is rarely secure
  • 27. data protection for client-server apps #doios @vixentael Software is buggy http://blog.mindedsecurity.com/2015/03/ssl-mitm-attack-in-afnetworking-251- do.html AFNetworking SSL verification bug (v2.5.1-2.5.2) https://eprint.iacr.org/2013/049.pdf Out-of-the-box SSL is frequent subject to attacks http://www.dwheeler.com/essays/apple-goto-fail.html Apple “goto fail” vulnerability http://noxxi.de/howto/ssl-debugging.html
  • 28. ๏ Copying bad code from StackOverflow ๏ Debugging by tearing security suites apart ๏ Avoiding “complicated” security documentation data protection for client-server apps #doios @vixentael Software is buggy.Why?
  • 29. - is easy to f*ck up - is inconvenient to implement Cyber-world security
  • 30. - use good practice and brain - use good tools - minimize re-inventing the wheel What shall we do?
  • 31. data protection for client-server apps #doios @vixentael Realize threat vectors Bad cryptography No access control Authentication bypass Credential reuse Session hijacking Denial of Service Data leakage …
  • 32. Anyone can invent a security system that he himself cannot break — Schneier's Law https://www.schneier.com/blog/archives/ 2011/04/schneiers_law.html data protection for client-server apps #doios @vixentael Implementing security tools yourself is a threat
  • 33. Do not re-implement existing things data protection for client-server apps #doios @vixentael
  • 34.
  • 35. Use great tools scientific background trust big guys good track record data protection for client-server apps #doios @vixentael libsodium/NaCL OTRKit RNCryptor MIHCrypto Themis https://github.com/mochtu/libsodium-ios https://github.com/ChatSecure/OTRKit https://github.com/RNCryptor/RNCryptor https://github.com/hohl/MIHCrypto https://github.com/cossacklabs/themis
  • 36. Apple open sourced crypto data protection for client-server apps #doios @vixentael
  • 38. Do your SSL/TLS right ๏use long keys ๏disable backward compatibility ๏use strong ciphers (EC vs RSA) ๏pin SSL certificate ๏use cheat sheet https://www.cossacklabs.com/avoid-ssl-for-your- next-app.html SSL has a lot of problems To survive you need to: data protection for client-server apps #doios @vixentael https://www.owasp.org/index.php/ Transport_Layer_Protection_Cheat_Sheet
  • 39. Do you pin SSL certificate? data protection for client-server apps #doios @vixentael
  • 40. SSL/TLS in short data protection for client-server apps #doios @vixentael hello client asks certificate server sends cert encrypted data client verifies cert - domain, - expiration date, - asks CA if cert is valid and not revoked key negotiation
  • 41. Where can it break? data protection for client-server apps #doios @vixentael hello client asks certificate server sends cert encrypted data client verifies cert - domain, - expiration date, - asks CA if cert is valid and not revoked key negotiation
  • 42. SSL pinning data protection for client-server apps #doios @vixentael hello client asks certificate server sends cert encrypted data client verifies cert - compares cert against pinned cert key negotiation
  • 43. SSL pinning on iOS https://possiblemobile.com/2013/03/ssl-pinning-for-increased-app-security/ https://www.paypal-engineering.com/2015/10/14/key-pinning-in-mobile- applications/ -­‐ (void)connection:(NSURLConnection  *)connection   willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge  *)challenge  {        SecTrustRef  serverTrust  =  challenge.protectionSpace.serverTrust;        id<NSURLAuthenticationChallengeSender>  sender  =  challenge.sender;        SecCertificateRef  certificate  =  SecTrustGetCertificateAtIndex(serverTrust,  0);        NSData  *  remoteCertificateData  =   CFBridgingRelease(SecCertificateCopyData(certificate));              NSString  *  cerPath  =  [[NSBundle  mainBundle]  pathForResource:@"MyLocalCertificate"   ofType:@"cer"];        NSData  *  localCertData  =  [NSData  dataWithContentsOfFile:cerPath];        if  ([remoteCertificateData  isEqualToData:localCertData])  {                NSURLCredential  *  credential  =  [NSURLCredential  credentialForTrust:serverTrust];                [sender  useCredential:credential  forAuthenticationChallenge:challenge];        }  else  {                [sender  cancelAuthenticationChallenge:challenge];        }   } data protection for client-server apps #doios @vixentael
  • 44. SSL pinning more easy :) let  certData  =  NSData(contentsOfFile:   NSBundle.mainBundle().pathForResource("lvwenhancom",  ofType:  "cer")!)!
 ...  ...   .addSSLPinning(LocalCertData:  certData)  {  ()  -­‐>  Void  in
        print("Under  Man-­‐in-­‐the-­‐middle  attack!")
 } data protection for client-server apps #doios @vixentael Swift lib for HTTPS and SSL pinning https://github.com/johnlui/Pitaya https://github.com/iSECPartners/ssl-conservatory
  • 45. Nah. SSL is not enough :( So,we’re done?
  • 47. Forward Secrecy: Threat Eve records encrypted traffic New crypto vulnerability allows to exact keys Eve physically extracts keys from one of the birds Eve decrypts all encrypted traffic data protection for client-server apps #doios @vixentael
  • 48. Forward Secrecy: Mitigation Forward Secrecy ephemeral keys + key rotation scheme data protection for client-server apps #doios @vixentael https://weakdh.org/imperfect-forward-secrecy-ccs15.pdf SSL/TLS has forward secrecy but it’s weak: =
  • 49. Using ephemeral key data protection for client-server apps #doios @vixentael key negotiation (RSA or EC) create symmetric temp key use temp key to encrypt messages during session close session open session
  • 50. Implementing ephemeral keys 1. establish session 2. encrypt message with SecureSession before sending 3. decrypt message after receive 4. encrypt history with SecureCell data protection for client-server apps #doios @vixentael https://github.com/cossacklabs/themis Themis has built-in forward secrecy inside SecureSession object
  • 51. Implementing ephemeral keys data protection for client-server apps #doios @vixentael https://github.com/cossacklabs/mobile-websocket-example
  • 53. What we need to do 1. Choose good storage library with efficient crypto 2. Embed it on read/write 3. Store keys safely data protection for client-server apps #doios @vixentael
  • 54. RNCryptor example Themis SecureCell example data protection for client-server apps #doios @vixentael Storage libraries
  • 55. data protection for client-server apps #doios @vixentael Storing the keys SSKeychain example Valet example https://github.com/square/Valet https://github.com/soffes/sskeychain
  • 56. compute key and use KDF to derive data protection for client-server apps #doios @vixentael Storing the keys: Computable obfuscation https://www.mikeash.com/pyblog/friday-qa-2012-08-10-a-tour-of- commoncrypto.html key = KDF(sqrt(42)*len(user_id)/parity(user_id))
  • 58. Practical app security step by step 1.Use HTTPS with good TLS settings 2.Enable SSL pinning 3.Encrypt user data in motion with ephemeral keys 4.Encrypt stored data and protect the key data protection for client-server apps #doios @vixentael
  • 59. Alice is more secure now data protection for client-server apps #doios @vixentael SSL pinning encrypted storage data ephemeral keys
  • 60. Bob is more secure now data protection for client-server apps #doios @vixentael encrypted storage data ephemeral keys
  • 61. Chatting is more secure 5720b3c2 fe674f54 73e10ad4 ... HTTPS SSL pinning ephemeral keys data protection for client-server apps #doios @vixentael
  • 62. Security is full of adventures and discoveries. And fun. andshinymetalbirds!
  • 63. The last slide @vixentael iOS developer at stanfy.com [creating awesome mobile and IoT apps] data protection for client-server apps #doios @vixentael take care!
  • 64. More to read ★ The Mobile Application Hacker's Handbook https://books.google.com.ua/books?id=UgVhBgAAQBAJ ★ Designing Secure User Interfaces https://developer.apple.com/library/ios/documentation/Security/ Conceptual/SecureCodingGuide/Articles/AppInterfaces.html#//apple_ref/ doc/uid/TP40002862-SW1 ★ CryptoCat iOS app security audit https://nabla-c0d3.github.io/documents/iSEC_Cryptocat_iOS.pdf ★ Storing secret keys http://www.splinter.com.au/2014/09/16/storing-secret-keys/
  • 65. More to watch ★ All talks of Moxie Marlinspike https://www.youtube.com/watch?v=ibF36Yyeehw https://www.youtube.com/watch?v=8N4sb-SEpcg https://www.youtube.com/watch?v=tOMiAeRwpPA