aboutsummaryrefslogtreecommitdiffstats
path: root/docs/primitives
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2013-08-08 07:16:01 -0700
committerAlex Gaynor <alex.gaynor@gmail.com>2013-08-08 07:16:01 -0700
commitf6c47e9eacdcd096b5d112d73b96f7e84f908f61 (patch)
tree1ab7be82a8c7d58862da2ad3102dddf4790526ee /docs/primitives
parent80cc92042283e9afc00f98ff94757d9d2701c043 (diff)
downloadcryptography-f6c47e9eacdcd096b5d112d73b96f7e84f908f61.tar.gz
cryptography-f6c47e9eacdcd096b5d112d73b96f7e84f908f61.tar.bz2
cryptography-f6c47e9eacdcd096b5d112d73b96f7e84f908f61.zip
Started trying to document symmetric encryption
Diffstat (limited to 'docs/primitives')
-rw-r--r--docs/primitives/index.rst7
-rw-r--r--docs/primitives/symmetric-encryption.rst22
2 files changed, 29 insertions, 0 deletions
diff --git a/docs/primitives/index.rst b/docs/primitives/index.rst
new file mode 100644
index 00000000..1066e30e
--- /dev/null
+++ b/docs/primitives/index.rst
@@ -0,0 +1,7 @@
+Primitives
+==========
+
+.. toctree::
+ :maxdepth: 1
+
+ symmetric-encryption
diff --git a/docs/primitives/symmetric-encryption.rst b/docs/primitives/symmetric-encryption.rst
new file mode 100644
index 00000000..acb5fc17
--- /dev/null
+++ b/docs/primitives/symmetric-encryption.rst
@@ -0,0 +1,22 @@
+Symmetric Encryption
+====================
+
+Symmetric encryption is a way to encrypt (hide the plaintext value) material
+where the encrypter and decrypter both use the same key.
+
+Block ciphers
+-------------
+
+Block ciphers work by encrypting content in chunks, often 64- or 128-bits. They
+combine an underlying algorithm (such as AES), with a mode (such as CBC, CTR,
+or GCM). A simple example of encrypting content with AES is:
+
+.. code-block:: pycon
+
+ >>> from cryptography.primitives import BlockCipher, CBC
+ >>> from cryptography.primitives.aes import AES
+ >>> cipher = BlockCipher(AES(key), CBC(iv))
+ >>> cipher.encrypt("my secret message") + cipher.finalize()
+ # The ciphertext
+ [...]
+