# HG changeset patch # User Pascal Bellard # Date 1334815882 -7200 # Node ID 276c902b0cf13dc83d1eb82b86759f5a531f8f32 # Parent 7a644e6e7b18d9f947d4df461029b1ede0365f15 Up zerobin (0.13_alpha) diff -r 7a644e6e7b18 -r 276c902b0cf1 zerobin/receipt --- a/zerobin/receipt Wed Apr 18 17:48:33 2012 +0200 +++ b/zerobin/receipt Thu Apr 19 08:11:22 2012 +0200 @@ -1,7 +1,7 @@ # SliTaz package receipt. PACKAGE="zerobin" -VERSION="0.12_alpha" +VERSION="0.13_alpha" CATEGORY="network" SHORT_DESC="Online pastebin where the server has zero knowledge of pasted data." MAINTAINER="pascal.bellard@slitaz.org" @@ -9,7 +9,7 @@ WEB_SITE="http://sebsauvage.net/wiki/doku.php?id=php:zerobin" WGET_URL="http://sebsauvage.net/files/$TARBALL" -DEPENDS="php" +DEPENDS="php-gd" # Rules to configure and make the package. compile_rules() diff -r 7a644e6e7b18 -r 276c902b0cf1 zerobin/stuff/zerobin.u --- a/zerobin/stuff/zerobin.u Wed Apr 18 17:48:33 2012 +0200 +++ b/zerobin/stuff/zerobin.u Thu Apr 19 08:11:22 2012 +0200 @@ -1,19 +1,15 @@ --- lib/zerobin.js +++ lib/zerobin.js -@@ -24,10 +24,12 @@ - */ - function randomCipher(message) +@@ -175,7 +175,11 @@ { -- // Generate a random 256 bits key, encoded in base64: + if ($('textarea#message').val().length==0) return; // Do not send if no data. + showStatus('Sending paste...',spin=true); - var randomkey = sjcl.codec.base64.fromBits(sjcl.random.randomWords(8,0),0); -- // Then encrypt the compressed message with this key. -- var data = sjcl.encrypt(randomkey,compress(message)); + var randomkey = (window.location.hash.length > 2) ? + // force key + window.location.hash.substring(1) : + // Generate a random 256 bits key, encoded in base64: + sjcl.codec.base64.fromBits(sjcl.random.randomWords(8,0),0); -+ var data = sjcl.encrypt(randomkey,compress(message)); - return {'data':data,'key':randomkey}; - } - + var cipherdata = zeroCipher(randomkey,$('textarea#message').val()); + var data_to_send = { data:cipherdata, + expire:$('select#pasteExpiration').val(),