Slide 1

Slide 1 text

Maintaining cryptographic library for 12 languages @vixentael

Slide 2

Slide 2 text

Maintaining cryptographic library for 12 languages 14 @vixentael

Slide 3

Slide 3 text

@vixentael Head of customer solutions, security software engineer. Focused on data security, applied crypto and building e2ee schemes. vixentael.dev

Slide 4

Slide 4 text

cossacklabs.com/products Data security tools & solutions We make software to get data security right – from open-source and proprietary cryptographic tools to custom solutions and consulting. We are cryptographers, security engineers, system engineers, infrastructure engineers. @vixentael

Slide 5

Slide 5 text

Working with companies that care about data security Critical infrastructure, healthcare, payment processors, ML/AI, popular apps — where data security is a hard requirement.

Slide 6

Slide 6 text

USABLE

Slide 7

Slide 7 text

Cryptographic Failures – #2 OWASP Top10 2021 @vixentael owasp.org/Top10/

Slide 8

Slide 8 text

github.com/cossacklabs/themis same API across 14 platforms boring crypto hidden crypto-details recommended by OWASP tons of docs works on millions of devices Themis – the crypto lib 7yo, supported by a team @vixentael

Slide 9

Slide 9 text

Where Themis is used? mobile apps other libraries chats web- fi rst apps Cossack Labs software critical infra fi ntech docs.cossacklabs.com/themis/community/projects-that-use-themis/ AI/ML apps @vixentael

Slide 10

Slide 10 text

End-to-end encryption in Bear blog.bear.app/ cossacklabs.com/case-studies/bear/ @vixentael

Slide 11

Slide 11 text

ML models encryption in AI/ML app cossacklabs.com/case-studies/ai-ml-ip-protection/ @vixentael

Slide 12

Slide 12 text

I want to store data securely I want to send data securely I want to verify data integrity Solve security use-cases @vixentael

Slide 13

Slide 13 text

ephemeral keys built in key gen built in KDF AES GCM / AES CTR ECDH + ECC + AES ECC + ECDSA / RSA + PSS + PKCS#7 SecureMessage SecureCell SecureComparator OTR SMP + ECC ZKP github.com/cossacklabs/themis Themis: cryptosystems store encrypted encrypt for someone encrypt session communication authenticate SecureSession @vixentael

Slide 14

Slide 14 text

Themis OpenSSL BoringSSL LibreSSL BearSSL DSTU libsodium native GoCrypto crypto-backends Soter Themis Themis Core iOS Android Java python ruby WASM language wrappers Go rust js PHP C++ stable experimental @vixentael

Slide 15

Slide 15 text

Themis Core (server & desktop OS) Ubuntu Debian CentOS / RHEL macOS Windows @vixentael

Slide 16

Slide 16 text

Themis Core (server & desktop OS) Ubuntu 20.04 x64 Debian 11 x64 Ubuntu 18.04 x64 CentOS 8 x64 Debian 10 x64 Debian 9 x64 macOS 11.5 macOS 10.15 macOS 10.14 Windows Ubuntu 16.04 x64 CentOS 7 x64 Ubuntu 16.04 x32 Debian 9 x32 @vixentael

Slide 17

Slide 17 text

Themis OSs Ubuntu 20.04 x64 Debian 11 x64 Ubuntu 18.04 x64 CentOS 7 x64 Ubuntu 16.04 x64 Debian 10 x64 Debian 9 x64 CentOS 8 x64 macOS 11.5 macOS 10.15 macOS 10.16 Windows iOS 10 - iOS 15 Android API 23 - 30 @vixentael

Slide 18

Slide 18 text

easy to use or hard to misuse? Cryptographic tools should be

Slide 19

Slide 19 text

make make test sudo make install Easy to use @vixentael

Slide 20

Slide 20 text

make make test sudo make install Easy to use noone cares about your lib if they can’t install it using their fav package manager @vixentael

Slide 21

Slide 21 text

Themis Core: install Ubuntu Debian CentOS / RHEL macOS Windows apt-get install libthemis-dev apt-get install libthemis-dev yum install libthemis-devel brew install libthemis make nsis_installer @vixentael

Slide 22

Slide 22 text

Package managers npm install jsthemis pip install pythemis pip3 install pythemis gem install rbthemis mavenCentral() implementation ‘com.cossacklabs.com:themis:0.13.11’ npm install wasm-themis [dependencies] themis = “0.13.12” go get github.com/cossacklabs/themis/gothemis/... pod themis pod install github “cossacklabs/themis" carthage update @vixentael

Slide 23

Slide 23 text

iOS speci fi cs OpenSSL Soter Themis Themis iOS BoringSSL C lang ObjC ObjC app Swift app ObjC <> Swift interoperability CocoaPods Carthage SPM package managers Xcode/Swift update iOS update device update package manager update Open/BoringSSL update @vixentael

Slide 24

Slide 24 text

iOS speci fi cs @vixentael

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

Android speci fi cs Soter Themis Themis Java BoringSSL C lang Java <> C Java app Kotlin app Java <> Kotlin interoperability Themis jni @vixentael

Slide 27

Slide 27 text

Android speci fi cs Soter Themis Themis Java BoringSSL C lang Java <> C Java app Kotlin app Java <> Kotlin interoperability Themis jni complicated to debug complicated to build @vixentael

Slide 28

Slide 28 text

BoringSSL github.com/cossacklabs/themis/pull/352 CMake Error at /home/user/android-sdk/ndk-bundle/build/cmake/ android.toolchain.cmake:169 (message): GCC is no longer supported. See https://android.googlesource.com/platform/ndk/+/master/docs/ ClangMigration.md. @vixentael

Slide 29

Slide 29 text

BoringSSL github.com/cossacklabs/themis/pull/352 CMake Error at /home/user/android-sdk/ndk-bundle/build/cmake/ android.toolchain.cmake:169 (message): GCC is no longer supported. See https://android.googlesource.com/platform/ndk/+/master/docs/ ClangMigration.md. gcc -> clang @vixentael

Slide 30

Slide 30 text

BoringSSL github.com/cossacklabs/themis/pull/447 why so slow 🤔 @vixentael

Slide 31

Slide 31 text

BoringSSL don’t build examples 👍 github.com/cossacklabs/themis/pull/447 @vixentael

Slide 32

Slide 32 text

Multi-platform is hard BoringSSL is used in iOS libs by Google (Firebase) Themis iOS BoringSSL @vixentael

Slide 33

Slide 33 text

Multi-platform is hard BoringSSL is used in iOS libs by Google (Firebase) Themis iOS BoringSSL no AES XTS in BoringSSL iOS CocoaPod 😱 😱 😱 😱 😱 😱 @vixentael

Slide 34

Slide 34 text

Multi-platform is hard #define SOTER_BORINGSSL_DISABLE_XTS BoringSSL is used in iOS libs by Google (Firebase) Themis iOS BoringSSL no AES XTS in BoringSSL iOS CocoaPod @vixentael

Slide 35

Slide 35 text

Hard to misuse

Slide 36

Slide 36 text

— crypto that simply works, solidly resists attacks, never needs any upgrades. https://cr.yp.to/talks/2015.10.05/slides-djb-20151005-a4.pdf Daniel J. Bernstein Boring crypto @vixentael

Slide 37

Slide 37 text

"Don’t give users options, because they will mess it up. Just tell them what to do.” dev.to/cossacklabs/schneier-on-cryptography-live-interview-4mi7 Bruce Schneier No options @vixentael

Slide 38

Slide 38 text

encryption integration abstraction level complexity cipher crypto- library crypto- system boxed solution @vixentael pain

Slide 39

Slide 39 text

CommonCrypto AES @vixentael

Slide 40

Slide 40 text

Easy to make mistakes @vixentael

Slide 41

Slide 41 text

should be random should use KDF(key) uses AES CBC, not AES GCM padding? salt? 😬 Easy to make mistakes @vixentael

Slide 42

Slide 42 text

github.com/cossacklabs/themis Themis: hard to make mistakes @vixentael

Slide 43

Slide 43 text

hides cryptographic details: salt, IV, KDF, padding uses AES-256-GCM github.com/cossacklabs/themis generates strong encryption key Themis: hard to make mistakes @vixentael

Slide 44

Slide 44 text

hides cryptographic details: salt, IV, KDF, padding uses AES-256-GCM github.com/cossacklabs/themis Themis: built-in KDF uses KDF to transform passphrase into key: @vixentael

Slide 45

Slide 45 text

one API to rule them all @vixentael

Slide 46

Slide 46 text

Testing

Slide 47

Slide 47 text

Testing @vixentael

Slide 48

Slide 48 text

Testing @vixentael

Slide 49

Slide 49 text

Testing fuzzing memory, sanitizers, SAST integration tests unit tests per each language, crypto: NIST- speci fi ed for PRNG & AES per OS, per language clang, Valgrind, Splint, Cppcheck backwards compatibility tests AFL between versions @vixentael

Slide 50

Slide 50 text

CI & autotests integrated with Github unit tests, memory iOS, Android, macOS examples and tests everything 
 cross-platform tests GitHub actions: everything @vixentael

Slide 51

Slide 51 text

Testing tools dev.to/cossacklabs/automated-software-security-testing-for-devs-part-1-gcf @vixentael

Slide 52

Slide 52 text

Security testing cryptocoding internal review external audits tests github.com/veorq/cryptocoding zeroing, minimization, memory, constant time checks, etc cossacklabs.com/blog/macros-in-crypto-c-code.html @vixentael

Slide 53

Slide 53 text

One readme is not enough

Slide 54

Slide 54 text

1. Language-speci fi c docs @vixentael

Slide 55

Slide 55 text

1. Language-speci fi c docs “give me code!” “too much to read” @vixentael

Slide 56

Slide 56 text

@vixentael 2. “Safe to copypaste” code snippets

Slide 57

Slide 57 text

2. “Safe to copypaste” code snippets “how to use it in the app?” @vixentael

Slide 58

Slide 58 text

3. Example applications @vixentael

Slide 59

Slide 59 text

3. Example applications @vixentael

Slide 60

Slide 60 text

3. Example applications “but I am building unique app!” @vixentael

Slide 61

Slide 61 text

4. Use case speci fi c apps @vixentael

Slide 62

Slide 62 text

4. Use case speci fi c apps “your app works, but my app doesn’t” @vixentael

Slide 63

Slide 63 text

5. Codeless simulators debug the whole fl ow @vixentael docs.cossacklabs.com/simulator/interactive/

Slide 64

Slide 64 text

One readme is not enough 1. Language-speci fi c docs 2. “Safe to copypaste” code snippets 3. Example applications 4. Tutorials and use case speci fi c apps 5. Codeless simulators @vixentael

Slide 65

Slide 65 text

@vixentael

Slide 66

Slide 66 text

1. Encryption lib should be: multi-platform, maintained, secure by default, open sourced, easy to install, hard to misuse, tested. 2. Supporting libs is VERY complicated. 3. Better to spend time on features than the crypto code. Key points @vixentael

Slide 67

Slide 67 text

WE ARE HIRING! jobs.dou.ua/companies/cossack-labs/ vacancies/ [email protected] @vixentael