aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--AUTHORS.rst2
-rw-r--r--CONTRIBUTING.rst17
-rw-r--r--MANIFEST.in7
-rw-r--r--README.rst7
-rw-r--r--cryptography/__about__.py32
-rw-r--r--cryptography/__init__.py22
-rw-r--r--docs/index.rst19
-rw-r--r--docs/primitives/symmetric-encryption.rst2
-rw-r--r--setup.py59
10 files changed, 156 insertions, 15 deletions
diff --git a/.gitignore b/.gitignore
index 2bf40e7c..ecf07a08 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,7 @@ _build/
.tox/
*.egg-info/
.coverage
+cffi-*.egg/
+pycparser-*.egg/
+pytest-*.egg/
+dist/
diff --git a/AUTHORS.rst b/AUTHORS.rst
index 06e23d1f..3438aa04 100644
--- a/AUTHORS.rst
+++ b/AUTHORS.rst
@@ -5,3 +5,5 @@ AUTHORS
* Hynek Schlawack <hs@ox.cx>
* Donald Stufft <donald@stufft.io>
* Laurens Van Houtven <_@lvh.io>
+* Christian Heimes <christian@python.org>
+
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
index ff1a619c..3ee89b80 100644
--- a/CONTRIBUTING.rst
+++ b/CONTRIBUTING.rst
@@ -10,6 +10,13 @@ Code
When in doubt, refer to `PEP 8`_ for Python code.
+Every code file must start with the boilerplate notice of the Apache License.
+Additionally, every Python code file must contain
+
+.. code-block:: python
+
+ from __future__ import absolute_import, division, print_function
+
Docs
====
@@ -17,12 +24,12 @@ Write docstrings like this:
.. code-block:: python
- def some_function(some_arg):
- """
- Does some things.
+ def some_function(some_arg):
+ """
+ Does some things.
- :param some_arg: Some argument.
- """
+ :param some_arg: Some argument.
+ """
So, specifically:
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 00000000..a0d91cec
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,7 @@
+include LICENSE
+include AUTHORS.rst
+include CONTRIBUTING.rst
+include README.rst
+
+recursive-include tests *.py
+recursive-include tests/primitives/vectors *
diff --git a/README.rst b/README.rst
index 4379bb58..9188106e 100644
--- a/README.rst
+++ b/README.rst
@@ -13,9 +13,6 @@ recipes to Python developers.
It is currently in early development and isn't recommended for general usage
yet. It targets Python 2.6-2.7, Python 3.2+, as well as PyPy.
-Why a new crypto library for Python?
-------------------------------------
+You can find more documentation at `Read The Docs`_.
-None of the existing ones work on PyPy, and many of them are unmaintained or
-are based around very poor implementations of algorithms (i.e ones with known
-side-channel attacks).
+.. _`Read The Docs`: https://cryptography.readthedocs.org/
diff --git a/cryptography/__about__.py b/cryptography/__about__.py
new file mode 100644
index 00000000..16d631fd
--- /dev/null
+++ b/cryptography/__about__.py
@@ -0,0 +1,32 @@
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+from __future__ import absolute_import, division, print_function
+
+__all__ = [
+ "__title__", "__summary__", "__uri__", "__version__", "__author__",
+ "__email__", "__license__", "__copyright__",
+]
+
+__title__ = "cryptography"
+__summary__ = ("cryptography is a package designed to expose cryptographic "
+ "primitives and recipes to Python developers.")
+__uri__ = "https://github.com/alex/cryptography"
+
+__version__ = "0.1.dev1"
+
+__author__ = ("Alex Gaynor, Donald Stufft, Laurens van Houvten, "
+ "Jean-Paul Calderone, Chris Heime, and Indivdual Contributors")
+__email__ = "cryptography-dev@python.org"
+
+__license__ = "Apache License, Version 2.0"
+__copyright__ = "Copyright 2013 Donald Stufft"
diff --git a/cryptography/__init__.py b/cryptography/__init__.py
index e69de29b..f37bd227 100644
--- a/cryptography/__init__.py
+++ b/cryptography/__init__.py
@@ -0,0 +1,22 @@
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+from cryptography.__about__ import (
+ __title__, __summary__, __uri__, __version__, __author__, __email__,
+ __license__, __copyright__
+)
+
+
+__all__ = [
+ "__title__", "__summary__", "__uri__", "__version__", "__author__",
+ "__email__", "__license__", "__copyright__",
+]
diff --git a/docs/index.rst b/docs/index.rst
index 1d8ffda6..29f0b545 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -8,7 +8,24 @@ Welcome to ``cryptography``
``cryptography`` is a Python library which exposes cryptographic primitives and
recipes.
-Contents:
+Why a new crypto library for Python?
+------------------------------------
+
+We wanted to address a few issues with existing cryptography libraries in
+Python:
+
+* Lack of PyPy support.
+* Lack of maintenance.
+* Use of poor implementations of algorithms (i.e. ones with known side-channel
+ attacks).
+* Lack of high level, "Cryptography for humans", APIs.
+* Absence of algorithms such as AES-GCM.
+* Poor introspectability, and thus poor testability.
+* Extremely error prone APIs, and bad defaults.
+
+
+Contents
+--------
.. toctree::
:maxdepth: 2
diff --git a/docs/primitives/symmetric-encryption.rst b/docs/primitives/symmetric-encryption.rst
index 0812f6b9..9986d89d 100644
--- a/docs/primitives/symmetric-encryption.rst
+++ b/docs/primitives/symmetric-encryption.rst
@@ -14,7 +14,7 @@ where the encrypter and decrypter both use the same key.
>>> from cryptography.primitives.block import BlockCipher, ciphers, modes
>>> cipher = BlockCipher(ciphers.AES(key), modes.CBC(iv))
- >>> cipher.encrypt("my secret message") + cipher.finalize()
+ >>> cipher.encrypt(b"a secret message") + cipher.finalize()
# The ciphertext
[...]
diff --git a/setup.py b/setup.py
index 8fd8a724..a1305d2f 100644
--- a/setup.py
+++ b/setup.py
@@ -12,7 +12,23 @@
# limitations under the License.
import sys
-from setuptools import setup
+from setuptools import setup, find_packages
+
+
+about = {}
+with open("cryptography/__about__.py") as fp:
+ exec(fp.read(), about)
+
+
+CFFI_DEPENDENCY = "cffi>=0.6"
+
+install_requires = [
+ CFFI_DEPENDENCY,
+]
+
+setup_requires = [
+ CFFI_DEPENDENCY,
+]
install_requires = [
"cffi>=0.6",
@@ -22,7 +38,44 @@ if sys.version_info[:2] < (3, 4):
install_requires += ["enum34"]
setup(
- name="cryptography",
- license="Apache License, Version 2.0",
+ name=about["__title__"],
+ version=about["__version__"],
+
+ description=about["__summary__"],
+ license=about["__license__"],
+ url=about["__uri__"],
+
+ author=about["__author__"],
+ author_email=about["__email__"],
+
+ classifiers=[
+ "Development Status :: 2 - Pre-Alpha",
+ "Intended Audience :: Developers",
+ "License :: OSI Approved :: Apache Software License",
+ "Natural Language :: English",
+ "Operating System :: MacOS :: MacOS X",
+ "Operating System :: POSIX",
+ "Operating System :: POSIX :: BSD",
+ "Operating System :: POSIX :: Linux",
+ "Operating System :: Microsoft :: Windows",
+ #"Programming Language :: cffi",
+ "Programming Language :: Python",
+ "Programming Language :: Python :: 2",
+ "Programming Language :: Python :: 2.6",
+ "Programming Language :: Python :: 2.7",
+ "Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 3.2",
+ "Programming Language :: Python :: 3.3",
+ "Programming Language :: Python :: Implementation :: CPython",
+ "Programming Language :: Python :: Implementation :: PyPy",
+ "Topic :: Security :: Cryptography",
+ ],
+
+ packages=find_packages(exclude=["tests", "tests.*"]),
+
install_requires=install_requires,
+ setup_requires=setup_requires,
+
+ # for cffi
+ zip_safe=False,
)