Skip to main content

NuCypher IPFS

This Python SDK allows python developer experiment NuCypher network to securely upload and download your files to IPFS.

Installation

install with pip:

pip install nucypher-ipfs 

If runs into connect module issue, it may cause of duplicate dependencies, fix by

pip uninstall ipfs-api ipfsapi
pip install ipfsapi

Usage

To use this, you must first import it and specify host name and port of a runnning instance of Ursula:

>>> import nucypher_ipfs

>>> client = nucypher_ipfs.connect_ursula("https://localhost:9151")

This current version connects to public IPFS gateway of Infura through API thus no need to setup additional IPFS host.

Now that you have a client instance, you can make requests and process responses from the service. To begin we apparently need to get a public key of our recipient or we can generate a new one from following:

>>> recipient_privkeys, recipient_pubkeys = client.generate_recipient_keys()

Policy public keys will be required for the data owner to encrypt the data that belongs to the policy:

>>> policy_pubkey = client.generate_owner_policy_public_key(max_days=5)

Specify the file to be uploaded to IPFS network, the hash of our encrypted file will be returned when it finish.

>>> filename = "test.txt"

>>> receipt = client.uploadFile(filename=filename , policy_pubkey=policy_pubkey)
{'data_source_public_key': ..., 'hash_key': 'Qmd9RNRiyT6SUMPpxWJoRmZMVGEEMcBaPRKY6EdUGTvaLk'}

We can then take a look to our encrypted data by opening:

https://gateway.ipfs.io/ipfs/<your hash here>

A recipient can be deligated by provide their public key:

>>> policy_info = client.authorize(recipient_pubkeys=recipient_pubkeys, max_days=5)

Once eveything is ready, the recipient can now able to decrypt the file and download to the local machine:

>>> client.downloadFile(downloadFilename="downloadFile.txt",
        recipient_privkeys=recipient_privkeys, 
        receipt=receipt, 
        policy_info=policy_info)

Documentation

More detailed information on NuCypher:

https://github.com/nucypher/nucypher

License

This code is distributed under the terms of the MIT license. Details can be found in the file LICENSE in this repository.

Metadata

Release files for nucypher-ipfs 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nucypher-ipfs 0.0.5
File Size Uploaded Provenance Actions
nucypher-ipfs-0.0.5.tar.gz 4.1 kB Without provenance Details for nucypher-ipfs-0.0.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nucypher-ipfs 0.0.5
File Interpreter ABI Platform Actions
nucypher_ipfs-0.0.5-py3-none-any.whl Python 3 none any Details for nucypher_ipfs-0.0.5-py3-none-any.whl

Total release size: 9.5 kB

Release files / nucypher-ipfs-0.0.5.tar.gz

Download URL nucypher-ipfs-0.0.5.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e6c1b8624434e14a9c7e761828378146e7b322f0e3b0975a44bc1f1b347113c4
BLAKE2b-256 checksum
How to use checksums
0720b8358f602234bf0f2f5800930ef95960968b3cfd6a6d4347af3fc76cb073
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

Release files / nucypher_ipfs-0.0.5-py3-none-any.whl

Download URL nucypher_ipfs-0.0.5-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aac4501dc982295282b9da45776e436c9242d166614fd1017b53fc4f31b1e573
BLAKE2b-256 checksum
How to use checksums
dd51a658d6dd961d4f17a556dcb1413bda5346a4e7c80b7db50adc40f83f221c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

Security for nucypher-ipfs 0.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page