- Install pyUmbral dependencies (perhaps, a good idea to spin up a virtualenv before):
pip3 install cryptographypip3 install pynacl- Install
libffiheaders (in Debian-based Linux distributions:apt-get install libffi-dev)
- Clone pyUmbral and install it:
git clone https://github.com/nucypher/pyUmbral.gitpip3 install -e pyUmbral
- Copy the
nucypher.pyfile from this project to your own.- Use as
from nucypher import MockNetwork - The
MockNetworkobject is meant to be instantiated once and used as needed. - See the
test.pyfile for an example of how it's used.
- Use as
MockNetwork.grant-- Creates a mock policy on the mocked network. This will return a string with apolicy_id. You will use this policy ID to reencrypt and revoke the policy.MockNetwork.reencrypt-- Re-encrypts a CapsuleMtimes on the mock network. This requires a policy id, a min number of re-encryptions specified duringpre.split_rekey, and a capsule object. This returns a list of capsule frags for Bob to attach to his capsule and use duringpre.decrypt.MockNetwork.revoke-- Revokes a policy from the network and makes re-encryptions impossible. This makes theMockNetworkobject delete the stored kfrags stored on it per policy_id.
GitHub Links:
https://github.com/nucypher/pyUmbral/
https://github.com/nucypher/umbral-doc/
https://github.com/nucypher/nucypher-kms/
Community Links: