CGI-SecureState

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

	- Added params() to return more than one CGI parameter at a time
	- Added state_param() to return a name-value pair so other
          scripts can use the same session.
	- Allowed add() to add more than one parameter at a time.
	- Changed encipher() to be able to update the timestamp
	  on the state file if not given anything to encrypt.
	- Changed functionality of encipher() and decipher() to only
	  do encryption and decryption, and added save_memory() and
	  recover_memory() functions to actually interact with the
	  list of parameters in the CGI object.
	- Rewrite of encipher() and decipher() to use reverse-CBC
	  encryption instead of ECB encryption.


0.26  Tuesday, May 29, 2001
	- Quick and dirty bugfix ($test variable not declared)

0.25  Monday, May 28, 2001
	- Changed e-mail address
	- Fixed Makefile problems
	- Added note about future versions of CGI::SecureState

SecureState.pm  view on Meta::CPAN

	#add metadata to the beginning of the plaintext
	$length=length($buffer);
	$buffer=pack("N",$length).$time.$buffer;

	#pad the buffer to have a length that is divisible by 8
	if ($length%=8) {
	    $length=8-$length;
	    $buffer.=chr(int(rand(256))) while ($length--);
	}

	#encrypt in reverse-CBC mode
	$block=$cipher->encrypt(substr($buffer,-8,8));
	substr($buffer,-8,8,$block);

	$length=length($buffer) - 8;
	while(($length-=8)>-8) {
	    $block^=substr($buffer,$length,8);
	    $block=$cipher->encrypt($block);
	    substr($buffer,$length,8,$block);
	}



( run in 0.903 second using v1.01-cache-2.11-cpan-df04353d9ac )