Skip to main content

Python package for efficient dispersal of information that breaks a file of length N into n pieces, each of length N/m, so that every m pieces are sufficient to reconstruct the original file.

Project description

IDA

This is a library that implements the Information Dispersal Algorithm (IDA) introduced in [1]. IDA breaks up a file of size N into n fragments, each of size N/m such that the original file can be recovered from any m of these fragments. Note that after IDA splits the file, the total size of all the fragments is(n/m)N. The parameters n and m can be chosen such that their ratio is close to 1, and hence, the total size of all the fragments after splitting the original file is close to the size of the original file, making IDA space-efficient.

[1] Rabin, Michael O. "Efficient dispersal of information for security, load balancing, and fault tolerance." Journal of the ACM (JACM) 36.2 (1989): 335-348.

Installation

Use the package manager pip to install IDA.

pip install IDA-pkg

Issues

  • Warning: currently only works with small files!

Examples

The following is a simple example. That is, we split a file into 10 fragments such that any 5 of them are sufficient to recover the original data.

import IDA
fragments = IDA.split("test.txt", 10, 5) 

To reassemble the file, we take any 5 of the fragments, e.g., we take the first five fragments, then the following will return the content of the original file as a string.

import IDA
IDA.assemble(fragments[:5]) 

You can also write the output to a file.

IDA.assemble(fragments[:5], "output.txt") 

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

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

IDA-pkg-0.0.1.tar.gz (5.4 kB view hashes)

Uploaded Source

Built Distribution

IDA_pkg-0.0.1-py3-none-any.whl (7.3 kB view hashes)

Uploaded Python 3

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