[Tutor] encrypt a file in Python3
eryksun
eryksun at gmail.com
Sat Nov 10 08:59:29 CET 2012
On Sat, Nov 10, 2012 at 12:54 AM, <kendy at kendy.org> wrote:
>
> I want to encrypt a file, then decrypt it. I prefer to do it without adding any
> packages.
>
> $ uname -a
> Linux laptop 3.2.0-32-generic-pae #51-Ubuntu SMP
You'll either need to install the package "python3-crypto" or compile
it yourself.
To build it locally, you'll need to setup your build environment. The
packages build-essential, python3-dev, python3-setuptools, and
libgmp-dev should suffice. Once everything is setup, simply run the
following:
sudo easy_install3 --verbose pycrypto
On My Debian system it installs to
/usr/local/lib/python3.2/dist-packages/. You can also run the self
tests:
>>> import sys
>>> import Crypto.SelfTest
>>> Crypto.SelfTest.run(verbosity=1, stream=sys.stdout)
For me it ran 1078 tests (one dot per test).
More information about the Tutor
mailing list