Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/talhof8/gasper

Gasper is a CLI for safe, privacy-aware file storage based on Shamir's Secret Sharing
https://github.com/talhof8/gasper

backup cli file-upload golang privacy shamir-secret-sharing storage

Last synced: 2 months ago
JSON representation

Gasper is a CLI for safe, privacy-aware file storage based on Shamir's Secret Sharing

Awesome Lists containing this project

README

        


Gasper Logo

# Gasper

![](https://img.shields.io/github/issues/talhof8/gasper)
![](https://img.shields.io/github/stars/talhof8/gasper)
![](https://img.shields.io/github/license/talhof8/gasper)
![](https://img.shields.io/twitter/url?url=https%3A%2F%2Fgithub.com%2Ftalhof8%2Fgasper)

Back-up & encrypt your files in a distributed manner, across multiple stores of your choice, by splitting them to shares.
Retrieve them at any point, with only a minimum number of shares required for retrieval.

Each file is being split to multiple shares, all of which are distributed to different destinations defined by you (be it AWS S3, Dropbox, Google Drive, your local filesystem, FTP Server, etc...). You can retrieve your file at any given moment, even if you only have access to a part of the stores you originally used (down to a minimium threshold of your choice).

Gasper is based on the awesome [Shamir's Secret Sharing algorithm](https://en.wikipedia.org/wiki/Shamir%27s_Secret_Sharing).


Shamir's Secret Sharing

Source: Robin's Snippet blog

# Demo
#### Using local store
![](assets/demo-local.gif)

## Supported stores

| Type | Description | Attributes |
| ----------------- |-----------------------| --------------------------|
| `local` | Store share in a local directory | `directory-path` (string) |

Feel free to contribute your own stores - S3, Google Drive, Twitter, FTP, or anything else you'd like :)

### Adding a new store
1. Implement the `Store` interface (`pkg/storage/stores/store.go`):

```
// Store lets you store shares.
type Store interface {
// Store type.
Type() string

// Is store available?
// Useful especially for remote stores, such as ftp servers or s3 buckets.
Available() (bool, error)

// Puts a share in store.
Put(share *shares.Share) error

// Retrieves a share from store.
// If no share with the given File ID exists, returns ErrShareNotExists.
Get(fileID string) (*shares.Share, error)

// Deletes a share from store.
// If no share with the given File ID exists, returns ErrShareNotExists.
Delete(fileID string) error
}
```
2. Add it to the stores factory function `FromConfig()` (`pkg/storage/stores/factory.go`), so it can be used out-of-the-box in the CLI.
3. Enjoy!

For an example, see `pkg/storage/stores/local.go`.

## Installation
```
go get -u github.com/talhof8/gasper
```

## Usage
#### Store
```
gasper store --stores-config --file [--encrypt --salt --share-count --shares-threshold --verbose]
```
Outputs file ID and checksum on success which should be used for retrieval.

#### Retrieve
```
gasper retrieve --stores-config --file-id --destination [--checksum --encrypt --salt --verbose]
```

#### Delete
Best effort deletion.
```
gasper delete --stores-config --file-id [--verbose]
```

Stores configuration file:
```
{
"stores": [
{
"type": "",
"": "",
"": "",
"": ""
},
{
"type": "",
"": "",
...
}
]
}
```

## License
Gasper is released under GPL. See LICENSE.txt.