Skip to main content

Simple symmetric encryption built on cryptography

Project description

Simple symmetric encryption built on cryptography

Build Status codecov PyPI version

raho is a simple wrapper library for the cryptography module.

Installation

pip install raho

And in your Python file:

>>> import raho

Usage

With Fernets

>>> fernet = raho.generate_fernet()
>>> message = raho.encrypt('he is hiding behind the rock', fernet)
>>> message
'Z0FB...'
>>> raho.decrypt(message, fernet)
'he is hiding behind the rock'

With passwords

>>> message = raho.encrypt_with_password('they know water', 'dragon123')
>>> raho.decrypt_with_password(message, 'dragon123')
'they know water'

With key files

>>> fernet = raho.generate_key_file('key-file')
>>> message = raho.encrypt_with_key_file('falcon flies at dawn', 'key-file')
>>> raho.decrypt_with_key_file(message, 'key-file')
'falcon flies at dawn'

Command line

See raho --help for command-line usage examples.

Development

Environment Setup

Install python3, tox, twine and other dependencies:

sudo apt-get install -y curl git python3-dev python3-setuptools python3-wheel \
    tox twine

Install [pyenv](https://github.com/pyenv/pyenv-installer) (if not already
installed):

```sh
curl https://pyenv.run | bash
cat <<'EOF' >> "$HOME/.bashrc"
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
EOF
source "$HOME/.bashrc"

Clone the source:

git clone https://github.com/abhayagiri/raho.git
cd raho

Install the test Python versions with pyenv:

for v in $(cat .python-version); do
    [ "$v" != "system" ] && pyenv install -s $v
done

Commands

Test:

tox

Build:

python3 setup.py sdist bdist_wheel --universal

Test upload:

twine upload --repository-url https://test.pypi.org/legacy/ dist/*

Upload:

twine upload dist/*

Clean:

rm -rf __pycache__ .coverage .tox build coverage.xml dist *.egg-info *.pyc

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

raho-0.0.1.tar.gz (4.2 kB view hashes)

Uploaded source

Built Distribution

raho-0.0.1-py2.py3-none-any.whl (5.0 kB view hashes)

Uploaded py2 py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page