DesCrypt-Talk

Summary: Talk page for DesCrypt.
Users: (View? / Edit)

This space is for User-contributed commentary and notes. Please include your name and a date along with your comment.

Comments

Very practical tool, thanks! -pog

What about integrating or using AES (see e.g. http://www.fourmilab.ch/javascript )Klonk

--- Start of comment from dent

Here's how I got DesCrypt to work on pmwiki-2.2.24.

I know nothing about the internals of pmwiki so this is quite possibly the wrong way to go about things but i managed to get DesCrypt to work for me:

I changed the descrypt.src as mentioned below by Cynthia. I then replaced

$EditMessageFmt = $EditMessageFmt ."<input type='button' name='desButton' value='DESCRYPT' onClick='desClick(this.form,0);'/><P>";

with the new style (since pmwiki 2.0 I think)

$MessagesFmt[] = "<input type=\"button\" name=\"desButton\" value=\"DESCRYPT\" onClick=\"desClick(document.forms[1],0);\"/><P>";

Without this change you won't see the DESCRYPT button (see Roy's comment below).

I was reluctant to change pmwiki's core files (scripts/form.php) as Cynthia did so I had to reference the input form some other way. The method I used is pretty brittle, it simply picks the second form on the page. The smarter approach would be to take the first form after document.getElementById('wikiedit'). Change the onClick handler above as necessary to do things properly. Does anyone know why the pmwiki input form is unnamed?

--- Start of comment from Cynthia Oldham

Once I got this cookbook working, it is definitely an asset to my wiki.
I had two issues with trying to get descrypt to work.

1) The browser was not finding the javascript file.
I solved this problem by changing line 13 of des.php

from

 desscript.src = 'pub/descrypt/des.js';

to:

  desscript.src = 'http://www.. <insert full path> ../pmwiki/pub/descrypt/des.js'; 

The universal solution would be to use the "PubDirUrl" variable in the local/config.php

2) this.form was transfering "null" when passed when the "DESCRYPT" button was pushed. This is probably because the button is outside the form.

I solved this problem by:
a) Adding a form name of "EditForm" to the form by editing line 83 of scripts/form.php from:

 ':html' => "<form action='\$PageUrl?action=edit' method='post'><input

to:

 ':html' => "<form name='EditForm' action='\$PageUrl?action=edit' method='post'><input

b) Editing cookbook/des.php from:

$EditMessageFmt = $EditMessageFmt ."<input type='button' name='desButton' value='DESCRYPT' onClick='desClick(this.form,0);'/><P>";

to:

$EditMessageFmt = $EditMessageFmt ."<input type='button' name='desButton' value='DESCRYPT' onClick='desClick(document.EditForm,0);'/><P>";

I hope that these comments help the next person or for next version of descrypt. Thank-you for making this cookbook. Cynthia Oldham

--- Start of comment from Roy van Pelt

I've tried to configure this recipe for the latest stable pmwiki (2.1.27), including the changes suggested by Cynthia. Unfortunately no button shows up on the edit form.

At this point I don't have time to dive into the code, but it might be a change in the way the buttons are placed in the edit form ('insButton').

If anyone could help out it would be great. I could use this functionality!

Regards,

Roy

--- Start of comment/question from Michael

Is there any possibility to automatically encrypt every saving-action using a pre-defined password? That is: No need to enter a password and pressing the encrypt button after editing, no need of the descrypt markup, but pressing the save button would automatically encrypt the whole page? And accessing a page would automatically decrypt and display it, so without a link to have to be pressed for an password prompt? Just for ease of use. But so that, however, all the data would be transmitted and stored encryptedly.

Thank you for any idea.

Talk page for the DesCrypt recipe (users?).