Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: gallantlab/cottoncandy
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b63584b8cd66dead3d8817247bb4adecddba306e
Choose a base ref
..
head repository: gallantlab/cottoncandy
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 513ead2da58e1010c2b4ebe24b6277fc22f8f077
Choose a head ref
Showing with 1 addition and 37 deletions.
  1. +0 −16 README.md
  2. +0 −20 cottoncandy/options.py
  3. +1 −1 setup.py
16 changes: 0 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -150,22 +150,6 @@ See the [Google Drive setup instructions](https://github.com/gallantlab/cottonca
>>> cci = cc.get_interface(backend='gdrive')
```

### Encryption

`cottoncandy`provides a transparent encryption interface for AWS S3 and Google Drive. This requires the `pycrypto` package.

**WARNING**: Encryption is an advance feature. Make sure to create a backup of the encryption keys (stored in `~/.config/cottoncandy/options.cfg`). If you lose your encryption keys you will not be able to recover your data!

```python
>>> import cottoncandy as cc
>>> cci = cc.get_encrypted_interface('my_bucket_name',
ACCESS_KEY='FAKEACCESSKEYTEXT',
SECRET_KEY='FAKESECRETKEYTEXT',
endpoint_url='https://s3.amazonaws.com')
```



### Contributing
* If you find any issues with `cottoncandy`, please report it by submitting an issue on GitHub.
* If you wish to contribute, please submit a pull request. Include information as to how you ran the tests and the full output log if possible. Running tests on AWS can incur costs.
20 changes: 0 additions & 20 deletions cottoncandy/options.py
Original file line number Diff line number Diff line change
@@ -39,26 +39,6 @@ def get_keys():
result = resultb if (resulta is None) else resulta
return result

def generate_AES_key(bytes = 32):
"""Generates a new AES key
Parameters
----------
bytes : int
number of bytes in key
Returns
-------
key : bytes
"""
try:
from Crypto import Random
return Random.get_random_bytes(bytes)
except ImportError:
print('PyCrypto not install. Reading from /dev/random instead')
with open('/dev/random', 'r') as rand:
return rand.read(bytes)


def get_config():
config = configparser.ConfigParser()
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -60,7 +60,7 @@ def main(**kwargs):
include_package_data=True,
long_description=long_description,
install_requires=['six', 'botocore', 'boto3', 'python-dateutil',
'PyDrive', 'pycrypto'],
'PyDrive'],
**kwargs)

if __name__ == "__main__":