note
ikegami
You could try to use the C cypher and fall back on the Perl one. Something like
<c>
my $cypher;
if (eval { require Crypt::Twofish }) {
$cypher = 'Crypt::Twofish';
} elsif (eval { require Crypt::Twofish_PP }) {
warn("Crypt::Twofish not found. Falling back to slower Crypt::Twofish_PP\n") if $DEBUG;
$cypher = 'Crypt::Twofish_PP';
} else {
die("Neither Crypt::Twofish nor Crypt::Twofish_PP was found. Aborting");
}
</c>
or
<c>
my $cypher;
foreach (qw(
Crypt::Twofish
Crypt::Twofish_PP
)) {
my $mod = $_;
my $file = $_;
$file =~ s{::}{/}g;
$file .= '.pm';
if (eval { require $file }) {
$cypher = $mod;
last;
}
}
die("No acceptable encryption algorithm found. Aborting")
if not defined $cypher;
</c>
493962
493967