Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Anastasiia Vixentael - Don’t Waste Time on Learning Cryptography: Better Use It Properly

OWASP Kyiv
December 04, 2017

Anastasiia Vixentael - Don’t Waste Time on Learning Cryptography: Better Use It Properly

Video: https://www.youtube.com/watch?v=SfuN-r3FpdY
OWASP Kyiv Winter 2017 Meetup, Dec 2, 2017
https://www.owasp.org/index.php/Kyiv

OWASP Kyiv

December 04, 2017
Tweet

More Decks by OWASP Kyiv

Other Decks in Technology

Transcript

  1. @vixentael Product Engineer Feel free to reach me with any

    mobile security questions. I do check my inbox :)
  2. #owaspkyiv @vixentael 1. DEFINING THE DATA SCOPE sensitive user data

    GDPR / HIPAA / PCI DSS tech data (keys, logs)
  3. #owaspkyiv @vixentael 1. DEFINING THE DATA SCOPE sensitive user data

    GDPR / HIPAA / PCI DSS tech data (keys, logs) mistake 1. wrong scope definition
  4. #owaspkyiv @vixentael THINGS TO DECIDE ON PADDING KEY LENGTH KEY

    ROTATION MODE KEY DERIVATION KEY STORAGE KEY EXCHANGE DATA SCOPE ALGORITHM IV KEY REVOCATION
  5. #owaspkyiv @vixentael PADDING KEY LENGTH KEY ROTATION MODE KEY DERIVATION

    KEY STORAGE THINGS TO DECIDE ON KEY EXCHANGE BACKUPS PLATFORMS DATA SCOPE ALGORITHM IV KEY REVOCATION
  6. AES DES 3DES CBC CFB SEAL Salsa20 RSA DSA OFB

    SHARK RC4 DSS ECB CTR SEED #owaspkyiv @vixentael Blowfish
  7. AES DES 3DES CBC CFB SEAL Salsa20 RSA DSA OFB

    Blowfish SHARK RC4 DSS ECB CTR Twofish Camelia SEED Rabbit ECDSA #owaspkyiv @vixentael
  8. AS USERS WE WANT… more ciphers! more vulnerabilities! more side

    channel attacks! more attacks! more constant time checks :) more protocols! more patches! #owaspkyiv @vixentael
  9. BORING CRYPTO #owaspkyiv @vixentael — 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
  10. WHAT DO WE WANT? — HIGH-LEVEL FUNCTIONS I want to

    store data securely I want to send data securely I want to verify data integrity #owaspkyiv @vixentael
  11. WHAT DO WE WANT? store data securely send data securely

    verify data integrity key derivation key exchange key rotation sign/verify ephemeral keys encr / decr #owaspkyiv @vixentael — HIGH-LEVEL FUNCTIONS
  12. 1. HOW TO START? #owaspkyiv @vixentael pod try BoringSSL cmake

    -DANDROID_ABI=armeabi-v7a \ -DCMAKE_TOOLCHAIN_FILE=../third_party/ android-cmake/android.toolchain.cmake \ -DANDROID_NATIVE_API_LEVEL=16 \ -GNinja .. https://boringssl.googlesource.com/boringssl/+/HEAD/BUILDING.md
  13. #owaspkyiv @vixentael TRUSTED PLATFORM MODULE key management disk protection trust

    anchor built-in remote attestation provides cryptoprimitives
  14. #owaspkyiv @vixentael HSM & TPM: PROS fast hardware crypto! trusted

    environment known security guarantees keys calculations
  15. #owaspkyiv @vixentael HSM & TPM: CONS vendor lock / vendor

    trust bad for interactive encryption complicated to maintain (install, upgrade, support, not cross-platform)
  16. #owaspkyiv @vixentael HSM & TPM: PRO & CONS HSM app

    plaintext data plaintext data is far away from the place it is used
  17. #owaspkyiv @vixentael HSM/TPM + SOFTWARE CS keys calculations TPM /

    HSM own software cross-platform take best from both
  18. #owaspkyiv @vixentael cross-platform easy to install easy to use USING

    CRYPTO SHOULD BE LIKE.. audited open source time proven well-documented
  19. #owaspkyiv @vixentael EXAMPLE https://github.com/cossacklabs/hermes-core/wiki/Python-tutorial data access control based on crypto-keys

    python docs/examples/python/hermes_client.py --id user1 --config=docs/examples/python/config.json --private_key user1.priv --doc testfile --read
  20. #owaspkyiv @vixentael 3. BOXED SOLUTIONS truecrypt ssh acra vault unites

    crypto-systems and user functions for solving problems
  21. #owaspkyiv @vixentael EXAMPLE https://github.com/cossacklabs/acra/wiki/Trying-Acra-with-Docker database proxy for encrypting / decrypting

    go run cmd/acra_genkeys/acra_genkeys.go docker-compose -f docker/docker-compose.yml up -d
  22. LINKS 1 Boring crypto, Daniel J. Bernstein https://cr.yp.to/talks/2015.10.05/slides-djb-20151005-a4.pdf Why does

    cryptographic software fail? https://pdos.csail.mit.edu/papers/cryptobugs:apsys14.pdf API design for cryptography https://2017.hack.lu/archive/2017/hacklu-crypto-api.pdf
  23. LINKS 2 Encrypting strings in Android: Let’s make better mistakes

    https://tozny.com/blog/encrypting-strings-in-android-lets-make-better-mistakes/ Awesome crypto papers https://github.com/pFarb/awesome-crypto-papers 12 And 1 Ideas How To Enhance Backend Data Security https://www.cossacklabs.com/backend-data-security-modern-ideas.html Attestation and Trusted Computing https://courses.cs.washington.edu/courses/csep590/06wi/finalprojects/bare.pdf
  24. @vixentael Product Engineer Feel free to reach me with any

    mobile security questions. I do check my inbox :)