Twofish(3pm)
π Crypt::Twofish π
okay bestie, so this is the manual for Crypt::Twofish(3pm) β the Perl module that does the Twofish encryption thing. and when I say it does it, I mean it ate. let's get into it π«Ά
β¨ NAME β¨
Crypt::Twofish β literally the Twofish Encryption Algorithm. that's her. that's the whole vibe. π
πΈ SYNOPSIS πΈ
use Crypt::Twofish;
$cipher = Crypt::Twofish->new($key);
$ciphertext = $cipher->encrypt($plaintext);
$plaintext = $cipher->decrypt($ciphertext);
four lines. that's it. no cap, that's the entire energy of getting your encrypt on. π
π¦ DESCRIPTION π¦
so Twofish is a 128-bit symmetric block cipher with a variable length key β you can roll with 128, 192, or 256-bit keys, pick your fighter β¨. it was developed by Counterpane Labs, and it is unpatented and free for all uses, exactly as described over at <URL:http://www.counterpane.com/twofish.html>. iconic behavior honestly π
this module implements Twofish encryption. it supports the Crypt::CBC interface, with the functions described down below. it also provides an interface that is call-compatible with Crypt::Twofish 1.0 β but bestie, listen to me β its use in new code is strongly discouraged. like, it's giving legacy. it's giving nostalgia. do not build your new thing on it, fr fr π
π Functions π
blocksizeβ returns the size (in bytes) of the block. that's16in this case, periodt.keysizeβ returns the size (in bytes) of the key. okay so even though the module fully understands 128, 192, and 256-bit keys, it returns16anyway β for compatibility withCrypt::CBC. it's doing it for the team π«Άnew($key)β this creates a new Crypt::Twofish object with the key you specified, which should be 16, 24, or 32 bytes long. choose wisely bestie β¨encrypt($data)β encryptsblocksize()bytes of$dataand hands you back the corresponding ciphertext. slay π₯decrypt($data)β decryptsblocksize()bytes of$dataand hands you back the corresponding plaintext. the reverse girlies, we love them π
π SEE ALSO π
Crypt::CBCCrypt::BlowfishCrypt::TEA
the whole cipher friend group. iykyk π§
π ACKNOWLEDGEMENTS π
- Nishant Kakani β for writing
Crypt::Twofish1.0 (and just so we're clear, this version is a complete rewrite). thank you for your service π«‘ - Tony Cook β for making the module work under Activeperl, testing on several platforms, and suggesting that I probe for features via
%Config. an absolute legend, no notes β
π AUTHOR π
Abhijit Menon-Sen <ams@toroid.org>
Copyright 2001 Abhijit Menon-Sen.
this module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. π
okay that's the whole page bestie, you're officially a Twofish girlie now πΈπ β¨
perl v5.42.3 Β· 2026-08-19 Β· and that's the Crypt::Twofish(3pm) energy, mwah ππ¦
π¦ where this page comes from
- ubuntu stonking: libcrypt-twofish-perl 2.18-1build7 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms