combox

split and encrypted files between online file storage providers
git clone git://git.ricketyspace.net/combox.git
Log | Files | Refs

commit e8f6d2bcad12e62ba33e7b74bd9bac85b538576c
parent 0cfeecae844dc1f16f5d5dac8a3cd91ae9d34675
Author: Siddharth Ravikumar <sravik@bgsu.edu>
Date:   Thu, 15 Oct 2015 22:47:04 -0400

combox/crypto.py: the split_and_encrypt function is timed now.

Diffstat:
combox/crypto.py | 9+++++++++
1 file changed, 9 insertions(+), 0 deletions(-)

diff --git a/combox/crypto.py b/combox/crypto.py @@ -26,8 +26,10 @@ from combox.file import (read_file, write_file, read_shards, write_shards, split_data, glue_data, relative_path) +from combox.log import log_i from Crypto.Cipher import AES +from datetime import datetime from os import path BLOCK_SIZE = 32 @@ -103,6 +105,8 @@ def split_and_encrypt(fpath, config, fcontent=None): the file. """ + start = datetime.now() + rel_path = relative_path(fpath, config) # no. of shards = no. of nodes. @@ -126,6 +130,11 @@ def split_and_encrypt(fpath, config, fcontent=None): write_shards(ciphered_shards, nodes, f_basename) + end = datetime.now() + duration = (end - start).total_seconds() * pow(10, 3) + log_i('Took %f ms to split and encrypt %s' % (duration, fpath)) + + def decrypt_and_glue(fpath, config, write=True):