Apache::Wyrd::Services::Key - Apache-resident crypto key (Blowfish)
<Perl> use strict; use Apache::Wyrd::Services::Key; Apache::Wyrd::Services::Key->instance(); </Perl>
A subclass of the Singleton class, the key is created using the instance method, not the new method.
instance
new
Generates a random cryptographic key (for Blowfish) for use with an Apache::Wyrd::Services::CodeRing object. Designed to be used at server startup in order to keep the key in shared memory. As the key is never stored in a file and then changes on server restart, it cannot be obtained trivially. This makes it suitable for storing state information on the browser without exposing the internals of your program.
Apache::Wyrd::Services::CodeRing
If Blowfish is not available on your system, it will attempt Blowfish_PP (pure perl) before failing to compile.
Fixed keys are also possible. The instance method can also accept a string as an argument to use in place of a randomly-generated key.
In development environments, with frequent server restarts, it is advisable to use a fixed key to prevent your Form state and Login Cookies from becoming unusable.
(format: (returns) name (arguments after self))
Initialize the Key object. If an optional key is supplied, the cypher is initialized with that key. If not, a random key is generated.
key
Return the key.
cypher
Return the cypher, which will be a Crypt::Blowfish/_PP object.
Crypt::Blowfish/_PP
Unless a fixed key is used, any encrypted information is irretrievable on server restart.
Barry King <wyrd@nospam.wyrdwright.com>
General-purpose HTML-embeddable perl object
Copyright 2002-2007 Wyrdwright, Inc. and licensed under the GNU GPL.
See LICENSE under the documentation for Apache::Wyrd.
Apache::Wyrd
To install Apache::Wyrd, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Apache::Wyrd
CPAN shell
perl -MCPAN -e shell install Apache::Wyrd
For more information on module installation, please visit the detailed CPAN module installation guide.