From e9bff8995409c4c8af3e132fd1acdba7c564687b Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Sun, 11 Oct 2015 14:23:23 +0200 Subject: [PATCH] Fix #19 Set paranoia to 10 for key generation --- themes/default/public/js/lufi-up.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/themes/default/public/js/lufi-up.js b/themes/default/public/js/lufi-up.js index 0efb736..4979e1c 100644 --- a/themes/default/public/js/lufi-up.js +++ b/themes/default/public/js/lufi-up.js @@ -127,13 +127,18 @@ function handleFiles(f) { uploadFile(0, delay.value, del_at_first_view.checked); } +// Create random key +function genRandomKey() { + return sjcl.codec.base64.fromBits(sjcl.random.randomWords(8, 10), 0); +} + // Create progress bar and call slicing and uploading function function uploadFile(i, delay, del_at_first_view) { // Prevent exiting page before full upload window.onbeforeunload = confirmExit; // Create a random key, different for all files - var randomkey = sjcl.codec.base64.fromBits(sjcl.random.randomWords(8, 0), 0); + var randomkey = genRandomKey(); // Get the file and properties var file = window.files[i];