made compression configurable, fixes #38

This commit is contained in:
El RIDO 2019-06-23 19:45:40 +02:00
parent 848d3563f4
commit c2e060d464
No known key found for this signature in database
GPG key ID: 0F5C940A6BD81F92
8 changed files with 35 additions and 21 deletions

View file

@ -941,14 +941,14 @@ jQuery.PrivateBin = (function($, RawDeflate) {
// AES in Galois Counter Mode, keysize 256 bit,
// authentication tag 128 bit, 10000 iterations in key derivation
const spec = [
getRandomBytes(16), // initialization vector
getRandomBytes(8), // salt
100000, // iterations
256, // key size
128, // tag size
'aes', // algorithm
'gcm', // algorithm mode
'zlib' // compression
getRandomBytes(16), // initialization vector
getRandomBytes(8), // salt
100000, // iterations
256, // key size
128, // tag size
'aes', // algorithm
'gcm', // algorithm mode
$('body').data('compression') || 'zlib' // compression
], encodedSpec = [];
for (let i = 0; i < spec.length; ++i) {
encodedSpec[i] = i < 2 ? btoa(spec[i]) : spec[i];