Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/agent-hellboy/flask-hedcrypt
A flask extension which provide interface( set of APIs) having implemenation of some of the use cases of cryptography.
https://github.com/agent-hellboy/flask-hedcrypt
cryptography flask flask-extensions flask-sqlalchemy pycrypto pypdf2 python
Last synced: 8 days ago
JSON representation
A flask extension which provide interface( set of APIs) having implemenation of some of the use cases of cryptography.
- Host: GitHub
- URL: https://github.com/agent-hellboy/flask-hedcrypt
- Owner: Agent-Hellboy
- License: mit
- Created: 2020-05-03T14:18:01.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-06-12T10:33:20.000Z (over 3 years ago)
- Last Synced: 2023-03-05T14:07:49.100Z (over 1 year ago)
- Topics: cryptography, flask, flask-extensions, flask-sqlalchemy, pycrypto, pypdf2, python
- Language: Python
- Homepage:
- Size: 441 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# flask-hedcrypt
A flask extension which provide interface( set of APIs) having implemenation of some of the use cases of cryptography.
## General info* If None of the use cases are found in future then the flask name may be removed
from repo.As currently their is only one use case related to flask i.e. decorating the class
inherited from db.Model class of flask-sqlalchmey.* I want to decorate the class inherited from db.Model so that instead of
calculating the hash seperately using an API and then storing it into
the database. User should have an option to decorate the class and wrapper code
will calculate the derived key from ssid and username and store it as a new field name derived key.
**features**
-----------* Key Derivation in accordance with PKCS7.
* The derived key is used as a password.
* Derived Key is always inserted in every file you upload onto the server into the metadata of file(currently only pdf encryption is tested manualy)
* No one is ever able to see the files (e.g documents) except you as the file is stored as an encrypted file onto the server.
* You can use the APIs like key_derive and key_verify for password. But you also had an option to decerote the Model class in future for that you had to provide ssid and username into the model so that a key is derived from it (use this method if you want to use more funtionality of the extension).**Prerequisites**
------------------know how to use flask extensions
pip3 install -r requirements.txt**using**
--------Currently under developement
Welcoming you all to contribute in any possible way.
Please have a look at the todo.
git clone https://github.com/princekrroshan01/flask-hedcrypt/
cd flask-hedcrypt
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
For nowKey Derivation and Verification APIs
```
from flask import Flask
from flask_crypto.flask_crypto import Crypto
app = Flask(__name__)
crpt = Crypto(app)key = crpt.key_derive(b"data") # api to calculate key using PKCS7
crpt.key_verify(b"data", key) # api to verify the key
```
File Encryption and Decryption APIs (currently only text,pdf ,...)```
from flask_crypto.file_encryt_decrypt import FileEncryptDecryptfile_ecd = FileEncryptDecrypt(key)
file_edc.encrypt_file(file / path / to / encrypt) # api to encrypt file
file_edc.encrypt_file(file / path / to / decrypt) # api to decrypt file
```
**TODO**
---------- [ ] write configuration parameters for the extension.
- [x] file encryption and decryption support using symmetric key encryption.
- [ ] API for PGP(preety good privacy).
- [ ] coming up with the use case for API support to use asymmetric key encryption.
- [ ] write UnitTest for file encryption and decryptio.
- [ ] Writing deceroter class for flask-sqlalchemy model class.
- [x] Store Derived Key in metadata of file (For now PDF files).
- [ ] Use pytest to write tests for the package.**Contributing**
----------------
Welcome You all to improve this extension.
Please suggest some use cases.
Open to accept any harse reality about this extension.