<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>PyVideo.org - Erik Labianca</title><link>https://pyvideo.org/</link><description></description><lastBuildDate>Wed, 05 Sep 2012 00:00:00 +0000</lastBuildDate><item><title>Cryptography for Django Applications</title><link>https://pyvideo.org/djangocon-us-2012/cryptography-for-django-applications.html</link><description>&lt;h3&gt;Summary&lt;/h3&gt;&lt;p&gt;A review of encryption in the context of a web application storing
sensitive information. Topics covered include choosing whether to use
crypto, selection of tools, proper usage (including examples), and
operational considerations with respect to security assessment.&lt;/p&gt;
&lt;h3&gt;Description&lt;/h3&gt;&lt;div class="section" id="introduction"&gt;
&lt;h4&gt;Introduction&lt;/h4&gt;
&lt;p&gt;The web is a hostile place, and isn't showing any signs of becoming less
so. In order to mitigate this, many developers turn to cryptography.
Unfortunately, cryptography can be complicated, and is easily
circumvented if not properly handled. This presentation will provide an
introduction to cryptographic tools available to Python/Django
applications, appropriate use cases for each, proper usage, and
operational concerns necessary to operate in a certified environment.
Finally, we will also demonstrate a reusable application that wraps this
all up, providing secure key-management capabilities to a running Django
environment via the Django admin.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="why-encrypt"&gt;
&lt;h4&gt;Why Encrypt?&lt;/h4&gt;
&lt;/div&gt;
&lt;div class="section" id="rules-of-encryption"&gt;
&lt;h4&gt;Rules of Encryption&lt;/h4&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Don't do it if you don't need it.&lt;/li&gt;
&lt;li&gt;Don't write your own.&lt;/li&gt;
&lt;li&gt;Understand what you're doing if you do.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class="section" id="when-to-encrypt"&gt;
&lt;h4&gt;When to encrypt?&lt;/h4&gt;
&lt;div class="section" id="understand-what-you-re-protecting"&gt;
&lt;h5&gt;Understand what you're protecting&lt;/h5&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Data&lt;/li&gt;
&lt;li&gt;User records&lt;/li&gt;
&lt;li&gt;Code&lt;/li&gt;
&lt;li&gt;Systems&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class="section" id="understand-your-attack-vectors"&gt;
&lt;h5&gt;Understand your attack vectors&lt;/h5&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Data (backups, revision control)&lt;/li&gt;
&lt;li&gt;Systems&lt;/li&gt;
&lt;li&gt;Application&lt;/li&gt;
&lt;li&gt;Transport&lt;/li&gt;
&lt;li&gt;Client&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class="section" id="understand-the-types-of-encryption-you-might-use"&gt;
&lt;h5&gt;Understand the types of encryption you might use:&lt;/h5&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Hashing&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="section" id="passwords-are-a-special-case-use-a-key-derivation-function"&gt;
&lt;h6&gt;Passwords are a special case. Use a key derivation function&lt;/h6&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;PBKDF2 – Upgrade to Django 1.4!&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class="section" id="hashing-algorithms"&gt;
&lt;h6&gt;Hashing Algorithms&lt;/h6&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;MD5 - fine as a checksum. not fine as a cryptographic hash.&lt;/li&gt;
&lt;li&gt;SHA1 - fine as a checksum. becoming less fine as a cryptographic hash
every day&lt;/li&gt;
&lt;li&gt;SHA2 - so far so good. use as many bits as you can handle.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="section" id="symmetric-encryption"&gt;
&lt;h5&gt;Symmetric Encryption&lt;/h5&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Fast&lt;/li&gt;
&lt;li&gt;Reversible&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="section" id="algorithms-symmetric"&gt;
&lt;h6&gt;Algorithms (Symmetric)&lt;/h6&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Caesar Cipher (for fun puzzles)&lt;/li&gt;
&lt;li&gt;DES (don't use)&lt;/li&gt;
&lt;li&gt;AES (certified)&lt;/li&gt;
&lt;li&gt;Blowfish&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="section" id="asymmetric-encryption"&gt;
&lt;h5&gt;Asymmetric Encryption&lt;/h5&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Slow&lt;/li&gt;
&lt;li&gt;One-way&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="section" id="algorithms-asymmetric"&gt;
&lt;h6&gt;Algorithms (Asymmetric)&lt;/h6&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;RSA&lt;/li&gt;
&lt;li&gt;DSA&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="section" id="uses"&gt;
&lt;h6 class="h7"&gt;Uses&lt;/h6&gt;
&lt;div class="section" id="signing"&gt;
&lt;h6 class="h8"&gt;Signing&lt;/h6&gt;
&lt;p&gt;Web of Trust&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;PGP&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;PKI&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="encryption"&gt;
&lt;h6 class="h8"&gt;Encryption&lt;/h6&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;PGP&lt;/li&gt;
&lt;li&gt;SSL&lt;/li&gt;
&lt;li&gt;TLS&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="section" id="doing-it-right"&gt;
&lt;h4&gt;Doing it right&lt;/h4&gt;
&lt;div class="section" id="use-known-good-algorithms"&gt;
&lt;h5&gt;Use known-good algorithms&lt;/h5&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;AES-256&lt;/li&gt;
&lt;li&gt;SHA2&lt;/li&gt;
&lt;li&gt;RSA&lt;/li&gt;
&lt;li&gt;DSA&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class="section" id="use-known-good-implementations"&gt;
&lt;h5&gt;Use known-good implementations&lt;/h5&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Open Source is good&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class="section" id="extra-credit"&gt;
&lt;h5&gt;Extra Credit&lt;/h5&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;FIPS 140 certified implementations&lt;/li&gt;
&lt;li&gt;FIPS 140 / NIST configurations&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class="section" id="transport-always-use-https"&gt;
&lt;h5&gt;Transport (always use HTTPS)&lt;/h5&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Use good algorithms AES-256&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class="section" id="at-rest-insecure-servers-or-backups"&gt;
&lt;h5&gt;At Rest (insecure servers or backups)&lt;/h5&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Understand the ramifications of key management&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="section" id="examples"&gt;
&lt;h4&gt;Examples&lt;/h4&gt;
&lt;div class="section" id="hashing"&gt;
&lt;h5&gt;Hashing&lt;/h5&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Use a key-derivation function&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="section" id="don-t-be-linked-in"&gt;
&lt;h6&gt;Don't be linked-in&lt;/h6&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Salt your hashes (with a secret).&lt;/li&gt;
&lt;li&gt;Salt and pepper your hashes if possible (with a known unique value)&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="section" id="ssl"&gt;
&lt;h5&gt;SSL&lt;/h5&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Forced connections&lt;/li&gt;
&lt;li&gt;Making the application aware&lt;/li&gt;
&lt;li&gt;Hardened cipher selection&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="section" id="robust-pki"&gt;
&lt;h6&gt;Robust PKI&lt;/h6&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Client authentication&lt;/li&gt;
&lt;li&gt;SSL Test Page&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="section" id="id1"&gt;
&lt;h5&gt;Asymmetric Encryption.&lt;/h5&gt;
&lt;div class="section" id="key-management"&gt;
&lt;h6&gt;Key Management&lt;/h6&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Using GPG Agent&lt;/li&gt;
&lt;li&gt;GPG Manager App&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class="section" id="pgp-files"&gt;
&lt;h6&gt;PGP Files&lt;/h6&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="section" id="id2"&gt;
&lt;h5&gt;Symmetric Encryption.&lt;/h5&gt;
&lt;div class="section" id="id3"&gt;
&lt;h6&gt;Key Management.&lt;/h6&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Use Asymmetric Encryption&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class="section" id="use-a-unique-initialization-vector-if-possible"&gt;
&lt;h6&gt;Use a unique Initialization Vector if possible&lt;/h6&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;LoopBack Devices&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Erik Labianca</dc:creator><pubDate>Wed, 05 Sep 2012 00:00:00 +0000</pubDate><guid isPermaLink="false">tag:pyvideo.org,2012-09-05:/djangocon-us-2012/cryptography-for-django-applications.html</guid><category>DjangoCon US 2012</category><category>cryptography</category><category>django</category></item></channel></rss>