in reply to Two-Way Password Encryption

Some (untested) code...

Set the cookie containing the username and an encrypted key (the password + $key):
use Crypt::CBC; my $key = 'kjhAG43asoiudy3kjq43ajhali87LOljkYilKH84yiHLkjklasjsd98fu'; my $cipher = new Crypt::CBC($key,'Blowfish'); my $crypt = $cipher->encrypt($password); $cgi = new CGI; my $auth = "$user,$crypt"; $cookie = $cgi->cookie ( -name => 'hostauth', -value => $auth ); print $cgi->header (-type => 'text/html', -cookie => $cookie);
And then, whenever you want, you can decrypt the key in the cookie (using the same $key) and send it along to the LDAP server:
use Crypt::CBC; my $key = 'kjhAG43asoiudy3kjq43ajhali87LOljkYilKH84yiHLkjklasjsd98fu'; my $cipher = new Crypt::CBC($key,'Blowfish'); my $auth = $cipher->decrypt($cookie); # Send the $auth to the LDAP server...
-s.