Difference between revisions of "Pccipher"

From ProgClub
Jump to: navigation, search
(http://erectille-dysfunction.com/buy-kamagra-usa.html kamagra tablets)
(http://erectille-dysfunction.com/buy-kamagra-oral-jelly-usa.html kamagra oral jelly faq)
Line 11: Line 11:
 
http://erectille-dysfunction.com/buy-kamagra-usa.html kamagra tablets
 
http://erectille-dysfunction.com/buy-kamagra-usa.html kamagra tablets
  
== Links ==
+
http://erectille-dysfunction.com/buy-kamagra-oral-jelly-usa.html kamagra oral jelly faq
 
 
=== Blowfish related information ===
 
 
 
* [http://www.schneier.com/blowfish.html Bruce Schneier: The Blowfish Encryption Algorithm]
 
* [http://en.wikipedia.org/wiki/Blowfish_%28cipher%29 Blowfish on Wikipedia]
 
 
 
=== phpjs related information ===
 
 
 
* [http://phpjs.org/ phpjs]
 
 
 
=== jQuery related information ===
 
 
 
* [http://jquery.com/ jQuery]
 
 
 
=== QUnit related information ===
 
 
 
* [http://docs.jquery.com/QUnit QUnit]
 
* [https://github.com/jquery/qunit qunit on github]
 
 
 
=== SimpleTest related information ===
 
 
 
* [http://www.simpletest.org/ SimpleTest: Unit Testing for PHP]
 
* [https://simpletest.svn.sourceforge.net/svnroot/simpletest/simpletest/trunk/ SimpleTest svn repo]
 
 
 
=== Javascript encryption related information ===
 
 
 
Before using the pccipher javascript encryption library, it would behove you to read this article: [http://www.matasano.com/articles/javascript-cryptography/ Javascript Cryptography Considered Harmful]. As it points out, security through encryption in Javascript is pretty much impossible. That said, there are some benefits to using a Javascript encryption scheme, such as protecting user data even if the user saves a copy of the page as a HTML file on their hard-drive, and there is *some* value in using the Javascript encryption library as an obfuscator that will stop the less determined intruder. There was some [http://www.progclub.org/pipermail/list/2011-August/000017.html more discussion] about this on the ProgClub list that you might be interested in checking out or participating in.
 
  
 
== TODO ==
 
== TODO ==

Revision as of 18:03, 12 November 2011

Pccipher is the ProgClub encryption software. That's the software that allows you to encrypt and decrypt data in PHP and Javascript. It's compatible with 32-bit and 64-bit implementations of PHP, and should work in any Javascript capable web-browser. For other projects see Projects.

http://erectille-dysfunction.com/buy-apcalis-oral-jelly-usa.html apcalis oral jelly

http://erectille-dysfunction.com/buy-caverta-usa.html caverta cheap

http://erectille-dysfunction.com/buy-kamagra-soft-usa.html kamagra soft tabs

http://erectille-dysfunction.com/buy-tadalis-sx-usa.html tadalis sx

http://erectille-dysfunction.com/buy-kamagra-usa.html kamagra tablets

http://erectille-dysfunction.com/buy-kamagra-oral-jelly-usa.html kamagra oral jelly faq

TODO

Things to do, in rough order of priority:

  • Use the 'pccipher' namespace for phpjs
  • Flesh out the unit tests
  • Integrate with PHP mcrypt?
  • Compatible implementations in other languages
  • Twofish?

Done

Stuff that's done. Latest stuff on top.

  • JE 2011-10-30: fixed pccipher_encrypt and pccipher_decrypt functions
  • JE 2011-08-16: packaged in .tar.gz download files
  • JE 2011-08-16: documented usage process for Javascript and PHP
  • JE 2011-08-16: integrated SimpleTest testing framework for PHP
  • JE 2011-08-16: integrated QUnit testing framework for Javascript
  • JE 2011-08-16: fixed formatting to use \x02 .. \x03 wrapper
  • JE 2011-08-16: removed key crc, and added algorithm code
  • JE 2011-08-16: copied in existing code (support for Blowfish on PHP and Javascript)
  • JE 2011-08-16: created the project in svn
  • JE 2011-08-16: created project page

Tests

Javascript tests

You can run the Javascript tests for the latest stable release at:

http://www.progclub.org/pccipher/js/test/test.html

And the latest development snapshot (i.e. trunk) at:

http://www.progclub.org/pccipher-dev/js/test/test.html

PHP tests

Note: the PHP testing links have been removed, because they place the server under load, and at the moment ProgClub is being slashdotted by http://programming.reddit.com/ and we can't have everyone clicking on them!

Update: We're not being slashdotted anymore, but I think I'll leave the links out anyway. If you're clever you'll be able to find them for yourself. Better to run the tests on your own system.

Notes for implementers

If you are interested in incorporating the ProgClub pccipher into your project, here's what you need to know:

Javascript implementation

An example Javascript implementation:

 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
                     "http://www.w3.org/TR/html4/loose.dtd">
 <html>
 <head>
   <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
   <script type="text/javascript" src="http://www.progclub.org/pccipher/js/lib/phpjs/phpjs.js"></script>
   <script type="text/javascript" src="http://www.progclub.org/pccipher/js/src/pccipher.js"></script>

   <script type="text/javascript">
   $(document).ready(function(){

   var key = "my key (*your* key should be longer and more random)";
   var text = "my text";
   var data = pccipher_encrypt( text, key );
   text = pccipher_decrypt( data, key );

   alert( text );

   });
   </script>
   
 </head>
 <body>
   <h1>Pccipher example</h1>
 </body>
 </html>

PHP implementation

You probably want to setup an svn:externals to:

http://www.progclub.org/svnro/pcrepo/pccipher/tags/latest

Then you can use the PHP library with something like this:

 <?php

 error_reporting( E_ALL );
 ini_set( 'display_errors', 'On' );

 require_once( dirname( __FILE__ ) . '/path/to/pccipher/php/src/pccipher_auto.php' );

 $key = "my key (which isn't half as randomly awesome as *your* key will be)";
 $text = "my text";
 $data = pccipher_encrypt( $text, $key );
 $text = pccipher_decrypt( $data, $key );

 echo "<p>" . $text . "</p>";

 ?>