1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
|
================================================
README for the mcrypt wrapper for Python 2 and 3
Version 0.0.x
================================================
Hello! Thanks for downloading this wrapper library, and I hope it proves to
be useful to you.
The goal of this library is to be an easy-to-use, Pythonic wrapper around
the mcrypt library, such that it because easy for any Python programmer to
include encryption ability in his or her scripts or programs. It is
primarily developed on Ubuntu, using Python 3, but it is intended to be
supported for use on any UNIX-like system with mcrypt on either Python 2 or
Python 3. Windows is not officially supported, as I do not have a
development environment on a Windows system. I will accept patches for
Windows (see "Submitting Patches", below) so as not to exclude Python
programmers on Windows, but someone will have to volunteer to support it on
Windows because I cannot.
-------------------------
Supported Python Versions
-------------------------
Currently, this works for Python 3.x (it is tested on Python 3.1). There
are still some issues with it working on Python 2.x, so this release does
not support Python 2.x: Python 2.x will be supported in a future release,
just as soon as the issues are figured out. (I don't use Python 2.x, so it
may take me some time to sort those issues out.)
To be precise, the extension module itself appears to work (which provides
the raw_encrypt and raw_decrypt classes), but the EncryptedReader and
EncryptedWriter Python classes do not work on Python 2.x at this time.
Therefore, it is possible to use the extension module to perform very
low-level encryption and decryption tasks. A future release (hopefully, the
next release) will support Python 2 completely.
-----------
Major Notes
-----------
If you read nothing else in the README, read this section. It is important.
The API in this version of the mcrypt wrapper is NOT STABLE. That is, I
expect to improve the API as a result of feedback from people who are using
it. I expect that people who are using it will see that something could be
done a bit more efficiently, or more Pythonic, and contribute a patch (or
even just a use-case or scenario) that will ultimately result in the API for
this to be changed. I won't keep it unstable forever, but just be aware
that I do not guarantee that releases are API stable, though I will try to
keep any such changes to a minimum, and all API-breaking changes will be
announced before the release that breaks the API. The 0.0.x development
line and releases will be PARTICULARLY UNSTABLE, so do not use them in
production systems unless you're willing to potentially do a lot of rework
in order to upgrade to some future release.
This is my first Python extension, and my first library in Python. In
general, I'm pretty new to Python. I really like it. My goal is to make
this library as easy to use as possible. It provides a base class that
provides very little assistance, and it also provides classes that are
useful for other situations (e.g., working with io.IOBase streams, or
working with an entire container file, or whatever). However, if I have
done something in a way that goes against what is generally expected in the
Python world, please explain that to me (and also explain how I can improve
the code to make it better fit general expectations!) so that it can be
fixed. Please accept my apologies in advance if I manage to do something
strangely.
-------------------------
Building and Installation
-------------------------
This Python extension is written in Cython. However, Cython is not required
to build it; the .c files are distributed for both Python 2 and Python 3.
$ sudo python setup.py install
$ sudo python3 setup.py install
If you encounter problems, please let me know. Also include your operating
system (and distribution if it is not the only distribution for the type of
operating system you are using), mcrypt version, Python version, Cython
version, and the version of this extension. That way we can try to figure
out what's up and fix it.
----------------------
Using in Your Software
----------------------
Of course, there is little point to having an extension if you don't know
how to use it! :) To use this in your software, you need only to "import
pymcrypt" to load the extension, and then you can use all of the classes
that are provided.
I have tried to ensure that the on-line help (e.g., the Python docstrings)
are useful and informative. If they require any improvement at all, please,
please, PLEASE tell me that so that it can be fixed. Certainly at least
tell me what you expected to find, where you expected to find it, and what
you found instead (or did not find).
--------------
Reporting Bugs
--------------
While I try to ensure that there are no bugs in software that I write, I
don't always meet that goal. Please file bugs at Launchpad, in the pymcrypt
project, where this module is maintained. At a minimum you must include
code that shows the problem (an English description is not enough!) as well
as the input data and expected output data. Be very careful that you do not
post information that is sensitive -- even if you do not normally create
test cases with example data for other programs or libraries that you use or
work on, it is absolutely vital that you do so when filing a bug for this
project.
If there is no way to avoid filing a bug report that depends on sensitive
information, DO NOT POST THE BUG REPORT TO LAUNCHPAD and DO NOT EMAIL ME THE
BUG REPORT IN PLAIN TEXT. You can find my OpenPGP key on Launchpad if you
need to send such a bug report. If necessary, I will act as a consultant
and sign any appropriate non-disclosure agreements (however, I do have to
charge a fee in order to do so, because I spend a decent amount of money
keeping confidential data in my care, well, confidential). If for some
reason the data cannot be transmitted over the Internet at all, or you do
not trust me to honor a contract, then do find someone that you trust and
can help you. BUT DO NOT POST SENSITIVE INFORMATION ON OR OVER THE INTERNET
unless it is strongly encrypted using a PKI encryption mechanism. Period.
-------------------
Project Information
-------------------
As noted above, the project is hosted on Launchpad and it is named pymcrypt.
All of Launchpad's facilities (other than Translations) are used, so Q&A can
happen there, for example. For that matter, we will start using
Translations as soon as the code has been polished enough to have i18n and
L10n support added to it.
|