https://github.com/coleifer/beefish
simple file encryption with pycrypto
https://github.com/coleifer/beefish
Last synced: 9 months ago
JSON representation
simple file encryption with pycrypto
- Host: GitHub
- URL: https://github.com/coleifer/beefish
- Owner: coleifer
- License: mit
- Created: 2012-09-10T17:39:13.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2022-05-18T09:34:29.000Z (over 3 years ago)
- Last Synced: 2025-03-30T16:44:39.953Z (10 months ago)
- Language: Python
- Size: 12.7 KB
- Stars: 68
- Watchers: 4
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
beefish
=======
Easy file encryption using pycrypto
.. image:: http://media.charlesleifer.com/blog/photos/beefish.jpg
installing
----------
::
pip install beefish pycrypto
Alternatively::
pip install -e git+https://github.com/coleifer/beefish.git#egg=beefish
Dependencies:
* `pycrypto `_
command-line options
--------------------
Usage::
beefish.py [-tkedaq] in_file [out_file]
* ``-e`` - encrypt the provided ``in_file`` and write to ``out_file``
* ``-d`` - decrypt the provided ``in_file`` and write to ``out_file``
* ``-k`` - specify password as command-line argument (if unspecified you will
be securely prompted).
* ``-a`` - use AES-256 instead of the default "Blowfish" cipher.
* ``-t`` - run test suite
* ``-q`` - quiet mode (controls verbosity of test output).
examples
--------
beefish can be used to encrypt and decrypt file-like objects::
from beefish import encrypt, decrypt
# encrypting
with open('secrets.txt') as fh:
with open('secrets.enc', 'wb') as out_fh:
encrypt(fh, out_fh, 'secret p@ssword')
# decrypting
with open('secrets.enc') as fh:
with open('secrets.dec', 'wb') as out_fh:
decrypt(fh, out_fh, 'secret p@ssword')
you can use a shortcut if you like::
# encrypting
encrypt_file('secrets.txt', 'secrets.enc', 'p@ssword')
# decrypting
decrypt_file('secrets.enc', 'secrets.dec', 'p@ssword')
you can use it from the command-line::
beefish.py -e secrets.txt secrets.enc
beefish.py -d secrets.enc secrets.dec
to use AES-256 cipher instead of the default, which is blowfish:
beefish.py -a -e secrets.txt
beefish.py -a -d secrets.encrypted