SlideShare a Scribd company logo
Anastasiia Vixentael: 10 things you need to know before implementing cryptography
X THINGS
YOU NEED TO KNOW
@vixentael
before Implementing Cryptography
@vixentael Product Engineer
Feel free to reach me with
security questions.
I do check my inbox :)
#uikonf @vixentael
pdos.csail.mit.edu/papers/cryptobugs:apsys14.pdf
269 CVEs
from 2011-2014
17%
83%
bugs inside crypto libs
misuses of crypto libs
by individual apps
@vixentael
Attackers can
find ways
to bypass
security
measures.
@vixentael
Encryption –
walls & gates.
@vixentael
!
@vixentael
Harden all
the things!
@vixentael
🔑 protecting privacy
😶 passwords & auth
📝 plaintext secrets
🏎 transport
🌳 dependencies
@vixentael
gdpr-info.eu/art-4-gdpr/
SENSITIVE DATA
@vixentael
developer.apple.com/app-store/review/rejections/
Caring about
user data
prevents
rejections.
@vixentael
PROTECTING PRIVACY
@vixentael
Avoid
sensitive data
on screenshots.
@vixentael
developer.apple.com @vixentael
screenshieldkit.com
There’s a lib
for that!
@vixentael
(but close-sourced)
krausefx.com/blog/ios-privacy-watchuser-access-both-
iphone-cameras-any-time-your-app-is-running
UNHEALTHY PERMISSIONS
hello, Felix!
@vixentael
twitter.com/Viss/status/987028660585578496
Avoid accessing
the data your app
can work without.
UNHEALTHY PERMISSIONS
🙈
@vixentael
PASSWORD RULES
@vixentael
littlemaninmyhead.wordpress.com/2018/02/18/secure-coding-
understanding-input-validation/
INPUT VALIDATION
📐 check length
✋ escape SQL
📱💻 validate on both sides
@vixentael
from twitter
USE GOOD PASSWORD RULES
(not like this)
@vixentael
from twitter
USE GOOD PASSWORD RULES
(not like this)
@vixentael
(notlikethis)
USE GOOD PASSWORD RULES
@vixentael
MORE LIKE THESE:
Use long phrase (16+).
Disallow typical passwords.
Promote password managers usage.
well_known_comics_about_horse.png
owasp.org/index.php/
Talk:Password_length_&_complexity @vixentael
AUTHORIZATION &
AUTHENTICATION
@vixentael
krausefx.com/blog/ios-privacy-
stealpassword-easily-get-the-users-
apple-id-password-just-by-asking
DARK AUTH PATTERNS
Avoid asking
user password
all the time.
TouchID/FaceID & 2FA
BETTER AUTH
owasp.org/index.php/Mobile_Top_10_2016-M4-
Insecure_Authentication
michael-brown.net/2018/touch-id-
and-face-id-on-ios
twitter.com/ay8s/status/885230327441915904
developer.apple.com/documentation/
safariservices/sfauthenticationsession
SFAuthenticationSession
BETTER AUTH
https://medium.com/the-traveled-ios-developers-guide/ios-11-privacy-
and-single-sign-on-6291687a2ccc
Single Sign-On
BETTER AUTH
Ask pass on sensitive screens
@vixentael
Password Autofill
BETTER AUTH
medium.com/@abhimuralidharan/password-autofill-
for-ios-apps-for-faster-login-ios-11-1d9f77deb35a
Password Autofill
MAKE AUTH BETTER!
Single Sign-On
SFAuthenticationSession
Ask pass on sensitive screens
TouchID/FaceID & 2FA
@vixentael
objective-see.com/blog/blog_0x24.html
AUTH BUGS: DOUBLE SPACE
Test your
login flow 😬
@vixentael
PLAINTEXT SECRETS
@vixentael
STORING SECRETS IN PLAINTEXT
facebook.com/vstyran/posts/10156368247887372
rabota.ua stored
all passwords
‘very well
encrypted’.
@vixentael
STORING SECRETS IN PLAINTEXT
businessinsider.com/data-breaches-2018-4 @vixentael
Avoid storing
sensitive plaintext.
passwords
document pictureslicense plates
SSNs
credit cards
health data
home addresspassport num
phone num
@vixentael
mac4n6.com/blog/2018/3/30/omg-seriously-apfs-encrypted-plaintext-
password-found-in-another-more-persistent-macos-log-file
LOGGING SECRETS IN PLAINTEXT
/var/log/install.log
@vixentael
LOGGING SECRETS IN PLAINTEXT
@vixentael
CHECK YOUR SOURCE CODE
cfpb/clouseau
Automate
checking code
for forgotten
secrets.
@vixentael
motherboard.vice.com/en_us/article/a34g9j/iphone-
source-code-iboot-ios-leak
NOT ALL CODE SHOULD BE PUBLISHED
@vixentael
medium.com/@AyunasCode/how-to-hide-your-api-keys-367ef6589949
shanirivers.me/posts/hiding-your-api-keys-for-ios-projects
orta/cocoapods-keys
awslabs/git-secretsAvoid
publishing
keys.
DO NOT COMMIT KEYS
keys.plist → .gitignore
@vixentael
TRANSPORT SECURITY
@vixentael
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<false/>
</dict>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoadsInWebContent</key>
<true/>
</dict>
agostini.tech/2018/04/01/ios-application-security-part-five-
app-transport-security-ats/ @vixentael
github.com/ssllabs/research/wiki/SSL-and-TLS-
Deployment-Best-Practices
🔑 private keys RSA-2048, ECDSA-256
👍 obtain certificate from reliable CA
🚀 use TLS v1.3-v1.2🔐 use secure cipher suites
TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
✅ enable Forward Secrecy
✅ enable HSTS (web)
WELL-CONFIGURED SSL
@vixentael
owasp.org/index.php/Pinning_Cheat_Sheet
SSL PINNING
@vixentael
infinum.co/the-capsized-eight/ssl-pinning-revisited
let serverTrustPolicies: [String: ServerTrustPolicy] = [
“mydomain.com”: .pinPublicKeys(
publicKeys: ServerTrustPolicy.publicKeys(),
validateCertificateChain: true,
validateHost: true
)
]
let sessionManager = SessionManager(
serverTrustPolicyManager: ServerTrustPolicyManager(
policies: serverTrustPolicies
)
)
SSL PINNING
@vixentael
schrauger.com/the-story-of-how-wosign-gave-me-an-ssl-
certificate-for-github-com
SSL IS NOT ENOUGH: WOSIGN STORY
@vixentael
security.googleblog.com/2016/10/
distrusting-wosign-and-startcom.html
support.apple.com/en-us/HT204132
SSL IS NOT ENOUGH: WOSIGN STORY
@vixentael
transport	=	Transport()	
transport?.setupKeys(serverId,	serverPublicKey:	serverPublicKey)	
session	=	TSSession(userId:	clientIdData,	privateKey:															
clientPrivateKeyData,	callbacks:	transport!)	
startSession(clientId:	clientId,	message:	connectionMessage)
github.com/cossacklabs/themis/wiki/
Swift-Howto#secure-session
ENCRYPT OVER SSL
@vixentael
3RD PARTY CODE
@vixentael
krausefx.com/blog/trusting-sdks
DOWNLOAD LIBS / IDE
🔐 use HTTPS / VPN
✅ check certificate
1 check hash-sum
🛠 clone & build from source
Do you really
need that lib?
🧐 GDPR
@vixentael
CHECK 3RD PARTY LIBRARIES
🐛 Monitor & fix critical bugs
😷 Update if any security patch
😶 Update if any privacy change (GDPR)
🤖 Automate all the checks
@vixentael
🤖 AUTOMATE ALL THE CHECKS
snyk.io/whitesourcesoftware.com/
@vixentael
OTHER THINGS TO DO
@vixentael
store as HEX
replace chars
rename files to .mp3 combine from pieces
OBFUSCATE SENSITIVE BITS
.xib / .nib
inline keys
API urls
pjebs/Obfuscator-iOS
rename important
methods / constants
preemptive/PPiOS-Rename
@vixentael
DO NOT FORGET ABOUT
🥅
firewalls
8
IDS
⚠
SIEM
🍯
fake targets /
honey pots
🐍
poison records
@vixentael
Now, after easy things are done,
cryptography!
it’s time for
@vixentael
cryptography!
📦
storage
encryption
🚀
transport
encryption
🔑
key
management
@vixentael
https://www.cossacklabs.com/choose-your-ios-crypto.html
CryptoSwift
LAST BUT NOT LEAST
@vixentael
DON’T SAY THAT YOUR SECURITY IS
AMAZINGLY GOOD :)
twitter.com/c_pellegrino/status/981409466242486272 @vixentael
DON’T SAY THAT YOUR SECURITY IS
AMAZINGLY GOOD :)
twitter.com/c_pellegrino/status/981409466242486272 @vixentael
DON’T SAY THAT YOUR SECURITY IS
AMAZINGLY GOOD :)
twitter.com/fabricio_giglio/status/982362735924137984 @vixentael
KEYPOINTS
Keep an eye on the sensitive data during
the whole data flow.
do not
store
do not
collect
remove
fast
https://www.digitalinterruption.com/secure-mobile-development
Secure mobile development
LINKS
https://www.owasp.org/index.php/OWASP_Mobile_Security_Testing_Guide
Mobile security testing guide
https://www.cossacklabs.com/choose-your-ios-crypto.html
Choose iOS crypto lib
https://github.com/forter/security-101-for-saas-startups/blob/english/security.md
Organization security for startups
https://agostini.tech/2017/11/20/ios-application-security-part-1-setting-up-a-
testing-environment-for-ios-platform/
Series of posts about security testing
github.com/
vixentael/my-talks
MY OTHER SECURITY SLIDES
@vixentael Product Engineer
Feel free to reach me with
security questions.
I do check my inbox :)
IMAGE CREDITS
www.flaticon.com 
freepik, linector, switficons, pixelperfect, smashicons, icon pond,
dinosoftlabs
Authors:
Anastasiia Vixentael: 10 things you need to know before implementing cryptography

More Related Content

PDF
Lviv MD Day 2015 Анастасія Войтова "Data transfer security for mobile apps: w...
PDF
Wordpress security best practices - WordCamp Waukesha 2017
PDF
Safety first – best practices in app security​
PDF
unSEXY Conf 2013: Ainsley Braun, Tinfoil
PDF
Securing cyber footprint - Oct 2017
PPT
Web Servers
PDF
BGA Eğitim Kataloğu
PDF
OWASP, PHP, life and universe
Lviv MD Day 2015 Анастасія Войтова "Data transfer security for mobile apps: w...
Wordpress security best practices - WordCamp Waukesha 2017
Safety first – best practices in app security​
unSEXY Conf 2013: Ainsley Braun, Tinfoil
Securing cyber footprint - Oct 2017
Web Servers
BGA Eğitim Kataloğu
OWASP, PHP, life and universe

What's hot (19)

PDF
Lock it down
PDF
Passwords, Attakcks, and Security, oh my!
PDF
DevOps Days Kyiv 2019 -- Cut infrastructure cost with monitoring // Anton Chu...
PPTX
Wp security presentation
PPTX
Ed Saipetch EMC VMware Lightning Talk CloudCamp Cincy
PDF
Common mistake in nodejs
PDF
Secure Coding For Java - Une introduction
PPTX
CLUSIR INFONORD OWASP iot 2014
PDF
Cisco Connect 2018 Malaysia - Changing the equation-cybersecurity in digital ...
PDF
Fire alarms vs. Fire hoses: Keeping up with Dependencies
PDF
Dave Lewis - The Se7en Deadly Sins Of Web Security - Codemotion Berlin 2018
PDF
Its just a flesh wound
PPTX
Segurança da era do ssl everywhere
PDF
SOCIAL MEDIA AS A CYBER WEAPON
PPTX
Kludges and PHP. Why Should You Use a WAF?
PDF
Cisco Connect 2018 Malaysia - Cisco aci-delivering intent for data center net...
PPTX
Website Security - It Begins With Good Posture
PPTX
Lightning talk owasp_top10in10
PDF
Accelerating Incident Response in Organizations of Any Size
Lock it down
Passwords, Attakcks, and Security, oh my!
DevOps Days Kyiv 2019 -- Cut infrastructure cost with monitoring // Anton Chu...
Wp security presentation
Ed Saipetch EMC VMware Lightning Talk CloudCamp Cincy
Common mistake in nodejs
Secure Coding For Java - Une introduction
CLUSIR INFONORD OWASP iot 2014
Cisco Connect 2018 Malaysia - Changing the equation-cybersecurity in digital ...
Fire alarms vs. Fire hoses: Keeping up with Dependencies
Dave Lewis - The Se7en Deadly Sins Of Web Security - Codemotion Berlin 2018
Its just a flesh wound
Segurança da era do ssl everywhere
SOCIAL MEDIA AS A CYBER WEAPON
Kludges and PHP. Why Should You Use a WAF?
Cisco Connect 2018 Malaysia - Cisco aci-delivering intent for data center net...
Website Security - It Begins With Good Posture
Lightning talk owasp_top10in10
Accelerating Incident Response in Organizations of Any Size
Ad

Similar to Anastasiia Vixentael: 10 things you need to know before implementing cryptography (20)

PDF
Avoiding damage, shame and regrets data protection for mobile client-server a...
PDF
Anastasia Vixentael - Don't Waste Time on Learning Cryptography: Better Use I...
PDF
Data transfer security for mobile apps
PDF
Rails security: above and beyond the defaults
PDF
Getting Single Page Application Security Right
PDF
Securing Your BBC Identity
PDF
You wanna crypto in AEM
PDF
Security theatre (Scotland php)
PDF
Making Security Usable: Product Engineer Perspective
PPTX
Secure Your Mobile Apps
PPTX
Cqcon2015
PPT
Developing Secure Applications and Defending Against Common Attacks
PDF
Security Theatre - PHP UK Conference
PDF
Defense in Depth - Lessons Learned from Securing over 100,000 Drupal Sites
PDF
Magento Application Security [EN]
PDF
Cisco Cybersecurity #10YearChallenge
PDF
Continuous security
PDF
Security Theatre - Confoo
PDF
Sinn und Unsinn von SSL
PDF
The Four Horsemen of Mobile Security
Avoiding damage, shame and regrets data protection for mobile client-server a...
Anastasia Vixentael - Don't Waste Time on Learning Cryptography: Better Use I...
Data transfer security for mobile apps
Rails security: above and beyond the defaults
Getting Single Page Application Security Right
Securing Your BBC Identity
You wanna crypto in AEM
Security theatre (Scotland php)
Making Security Usable: Product Engineer Perspective
Secure Your Mobile Apps
Cqcon2015
Developing Secure Applications and Defending Against Common Attacks
Security Theatre - PHP UK Conference
Defense in Depth - Lessons Learned from Securing over 100,000 Drupal Sites
Magento Application Security [EN]
Cisco Cybersecurity #10YearChallenge
Continuous security
Security Theatre - Confoo
Sinn und Unsinn von SSL
The Four Horsemen of Mobile Security
Ad

More from mdevtalk (20)

PDF
Jan Čislinský: Seznámení se Sourcery aneb Základy metaprogramování ve Swiftu
PDF
Jarda Machaň: Proč je dobré míti Developer Evangelistu
PDF
Pavel Cvetler: Jeden kód, co vládne všem? Žádný problém pro Android i iOS
PDF
Michal Havryluk: How To Speed Up Android Gradle Builds
PDF
Vladislav Iliushin: Dark side of IoT
PDF
Georgiy Shur: Bring onboarding to life
PDF
David Bilík: Anko – modern way to build your layouts?
PDF
Maxim Zaks: Deep dive into data serialisation
PDF
Nikita Tuk: Handling background processes in iOS: problems & solutions
PDF
Milan Oulehla: Bezpečnost mobilních aplikací na Androidu
PDF
Tomáš Kohout: Jak zrychlit iOS vývoj pomocí Swift playgoundů
PDF
David Vávra: Firebase + Kotlin + RX + MVP
PDF
Adam Šimek: Optimalizace skrolování, RecyclerView
PDF
Paul Lammertsma: Account manager & sync
PDF
Charles Du: Introduction to Mobile UX Design
PDF
Honza Dvorský: Swift Package Manager
PDF
David Bureš - Xamarin, IoT a Azure
PDF
Dominik Veselý - Vše co jste kdy chtěli vědět o CI a báli jste se zeptat
PDF
Jiří Dutkevič: Ochrana citlivých dat v iOS
PDF
Petr Dvořák: Push notifikace ve velkém
Jan Čislinský: Seznámení se Sourcery aneb Základy metaprogramování ve Swiftu
Jarda Machaň: Proč je dobré míti Developer Evangelistu
Pavel Cvetler: Jeden kód, co vládne všem? Žádný problém pro Android i iOS
Michal Havryluk: How To Speed Up Android Gradle Builds
Vladislav Iliushin: Dark side of IoT
Georgiy Shur: Bring onboarding to life
David Bilík: Anko – modern way to build your layouts?
Maxim Zaks: Deep dive into data serialisation
Nikita Tuk: Handling background processes in iOS: problems & solutions
Milan Oulehla: Bezpečnost mobilních aplikací na Androidu
Tomáš Kohout: Jak zrychlit iOS vývoj pomocí Swift playgoundů
David Vávra: Firebase + Kotlin + RX + MVP
Adam Šimek: Optimalizace skrolování, RecyclerView
Paul Lammertsma: Account manager & sync
Charles Du: Introduction to Mobile UX Design
Honza Dvorský: Swift Package Manager
David Bureš - Xamarin, IoT a Azure
Dominik Veselý - Vše co jste kdy chtěli vědět o CI a báli jste se zeptat
Jiří Dutkevič: Ochrana citlivých dat v iOS
Petr Dvořák: Push notifikace ve velkém

Recently uploaded (10)

PDF
Kids, Screens & Emotional Development by Meenakshi Khakat
PDF
Lesson 13- HEREDITY _ pedSAWEREGFVCXZDSASEWFigree.pdf
PPTX
Social Media People PowerPoint Templates.pptx
PDF
2025 Guide to Buy Verified Cash App Accounts You Can Trust.pdf
DOC
NIU毕业证学历认证,阿比林基督大学毕业证留学生学历
DOC
Camb毕业证学历认证,格罗斯泰斯特主教大学毕业证仿冒文凭毕业证
DOC
SIUE毕业证学历认证,阿祖萨太平洋大学毕业证学位证书复制
PDF
Best 4 Sites for Buy Verified Cash App Accounts – BTC Only.pdf
PPTX
ASMS Telecommunication company Profile
PPTX
Introduction to Packet Tracer Course Overview - Aug 21 (1).pptx
Kids, Screens & Emotional Development by Meenakshi Khakat
Lesson 13- HEREDITY _ pedSAWEREGFVCXZDSASEWFigree.pdf
Social Media People PowerPoint Templates.pptx
2025 Guide to Buy Verified Cash App Accounts You Can Trust.pdf
NIU毕业证学历认证,阿比林基督大学毕业证留学生学历
Camb毕业证学历认证,格罗斯泰斯特主教大学毕业证仿冒文凭毕业证
SIUE毕业证学历认证,阿祖萨太平洋大学毕业证学位证书复制
Best 4 Sites for Buy Verified Cash App Accounts – BTC Only.pdf
ASMS Telecommunication company Profile
Introduction to Packet Tracer Course Overview - Aug 21 (1).pptx

Anastasiia Vixentael: 10 things you need to know before implementing cryptography