From d1d803e4f34b6ea4f90057fae4c25131616779ac Mon Sep 17 00:00:00 2001 From: anomen Date: Fri, 11 Jan 2013 09:12:31 +0100 Subject: [PATCH] www-apps/pmwiki - cookbook - AesCrypt updates --- www-apps/pmwiki/cookbook/AesCrypt/aescrypt.js | 12 +++++++----- www-apps/pmwiki/cookbook/AesCrypt/aescrypt.php | 5 ++--- www-apps/pmwiki/cookbook/AesCrypt/readme.txt | 5 +++-- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/www-apps/pmwiki/cookbook/AesCrypt/aescrypt.js b/www-apps/pmwiki/cookbook/AesCrypt/aescrypt.js index 36077fc..1dc6eaf 100644 --- a/www-apps/pmwiki/cookbook/AesCrypt/aescrypt.js +++ b/www-apps/pmwiki/cookbook/AesCrypt/aescrypt.js @@ -6,6 +6,12 @@ * http://www.movable-type.co.uk/scripts/aes.html * http://www.pmwiki.org/wiki/Cookbook/DesCrypt * http://www.pmwiki.org/wiki/Cookbook/AesCrypt + * + * Copyright 2011-2013 Anomen (ludek_h@seznam.cz) + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published + * by the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. */ @@ -503,12 +509,8 @@ AesCtr.kdf_sha256_dup = function(password, nBits, nonce) { var nBytes = nBits/8; var nonceEnc = Base64.encode(nonce); for (var i = 0; i < nBytes ; i++) { - buffer = buffer.concat(i); - buffer = buffer.concat(password.charAt(i % password.length)); - buffer = buffer.concat(password); - buffer = buffer.concat(nonceEnc); + buffer = buffer.concat(i, password.charAt(i % password.length), password, nonceEnc); } - //alert(buffer); var hash = Sha256.hash(buffer); return hash.slice(0, nBytes); } diff --git a/www-apps/pmwiki/cookbook/AesCrypt/aescrypt.php b/www-apps/pmwiki/cookbook/AesCrypt/aescrypt.php index c9a7580..9c708e9 100644 --- a/www-apps/pmwiki/cookbook/AesCrypt/aescrypt.php +++ b/www-apps/pmwiki/cookbook/AesCrypt/aescrypt.php @@ -3,7 +3,7 @@ /* AesCrypt - Copyright 2011 Anomen (ludek_h@seznam.cz) + Copyright 2011-2013 Anomen (ludek_h@seznam.cz) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or @@ -41,7 +41,6 @@ SDV($HTMLStylesFmt['aescrypt'], " background-image:none; background-color:#cccccc; background-repeat: repeat; - /*display:none; */ visibility: hidden; } @@ -110,7 +109,7 @@ function aescryptMarkup($ciphertext) } Markup('aescrypt', - 'directives', + "<[=", "/\\Q$AesCryptCipherToken\\E\\s*(.*?)\\s*\\Q$AesCryptEndToken\\E/se", "aescryptMarkup('$1')"); diff --git a/www-apps/pmwiki/cookbook/AesCrypt/readme.txt b/www-apps/pmwiki/cookbook/AesCrypt/readme.txt index e573cfb..2775ae3 100644 --- a/www-apps/pmwiki/cookbook/AesCrypt/readme.txt +++ b/www-apps/pmwiki/cookbook/AesCrypt/readme.txt @@ -40,10 +40,11 @@ require_once("$FarmD/cookbook/aescrypt.php"); @] !!!Supported browsers -This recipe should work in all current browsers with JavaScript support. Successfully tested on: +This recipe should work in all current browsers (as of end of 2012) with JavaScript support. +It was successfully tested on: * Windows (IE, Firefox, Opera, Chrome) * Linux (Firefox, Opera, Chromium) -* Android (Opera Mini 7.5) +* Android (Opera Mini 7.5 !!! This browser sends password to Opera servers !!!) !!!Java testing application Build application using Maven: -- 2.11.4.GIT