Posts

Showing posts from October, 2013

Python-gnupg on a Raspberry Pi

Installing Python-gnupg ( http://pythonhosted.org/python-gnupg/ ) on a Raspberry Pi shouldn't be much different than installing it on any other *nix system.  I'm documenting it here just for my own personal notes. Install gnupg This goes pretty much like you'd expect: sudo apt-get install gnupg Install Python-gnupg First we need pip (and setup_tools, ...): sudo apt-get install python-dev wget https://bitbucket.org/pypa/setuptools/raw/0.8/ez_setup.py -O - | sudo python curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py sudo python get-pip.py Now we can get gnupg: sudo pip install python-gnupg Basics The following script creates a key using gnupg and installs that key in ~/.gnupg: import gnupg gpg = gnupg.GPG() # generate a key # first we need the input data # really we shouldn't use key lengths shorter than 2048 input_data = gpg.gen_key_input(key_type="RSA",                  ...