Crypt:...owfish(3pm)

πŸ’– Crypt::Eksblowfish::Blowfish(3pm) β€” like, the Blowfish block cipher, bestie 🐑

okay so this whole page lives in the perl manual, section 3pm, and it's about Crypt::Eksblowfish::Blowfish β€” a Blowfish block cipher running on an Eksblowfish engine. yes the name is a mouthful. we move.


✨ NAME ✨

Crypt::Eksblowfish::Blowfish β€” the Blowfish block cipher, powered by the Eksblowfish engine. it's giving "fancy engine, classic cipher."


🌸 SYNOPSIS 🌸

use Crypt::Eksblowfish::Blowfish;

$block_size = Crypt::Eksblowfish::Blowfish->blocksize;
$key_size = Crypt::Eksblowfish::Blowfish->keysize;

$cipher = Crypt::Eksblowfish::Blowfish->new($key);

$block_size = $cipher->blocksize;
$ciphertext = $cipher->encrypt($plaintext);
$plaintext = $cipher->decrypt($ciphertext);

$p_array = $cipher->p_array;
$s_boxes = $cipher->s_boxes;
if($cipher->is_weak) { ...

like, that's the whole vibe in nine lines. everything below is just explaining what you already felt. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so an object of this type is literally a keyed-up instance of the Blowfish block cipher, sitting there, ready to encrypt and decrypt. main character behavior, honestly.

Blowfish itself? a symmetric cipher algorithm designed by Bruce Schneier in 1993 ✨. it works on 64-bit blocks, and it takes a variable-length key all the way from 32 bits (4 octets) up to 448 bits (56 octets), in increments of 8 bits (1 octet). so many sizes. so much range. we love options.

now the tea on this specific implementation β˜• β€” it uses an encryption engine that was originally built to support Eksblowfish, which is a variant of Blowfish modified to make keying particularly expensive (yes, on purpose, it's a whole thing). peep Crypt::Eksblowfish for that variant. this class, though? this class implements the original Blowfish. no cap. 🐑


πŸ‘‘ CLASS METHODS πŸ‘‘

  • Crypt::Eksblowfish::Blowfish->blocksize β€” returns 8, which is the Blowfish block size of 8 octets. and the cute part? you can call this method on either the class or an instance. flexible queen. 🫢
  • Crypt::Eksblowfish::Blowfish->keysize β€” returns 0, which is saying "the key size is variable, bestie." this specific situation gets handled specially by Crypt::CBC. iconique and slightly chaotic.

πŸŽ€ CONSTRUCTOR πŸŽ€

  • Crypt::Eksblowfish::Blowfish->new(KEY) β€” does key setup on a brand-new instance of the Blowfish algorithm and hands you back the keyed state. KEY can be any length from 4 octets to 56 octets inclusive. the range is the range, we don't make the rules.
🚨 okay important aside: you may occasionally run into some alleged "Blowfish key" that falls outside that length range, and this constructor will straight up reject it. the lore is that Blowfish can internally process a key of any octet length up to 72 octets, and some implementations just don't enforce the official length restrictions. so if you need compatibility with those, a key of out-of-range length can be processed by Crypt::Eksblowfish::Uklblowfish. iykyk. 🌈

πŸ’œ METHODS πŸ’œ

  • $cipher->blocksize β€” returns 8, the Blowfish block size of 8 octets. same energy as the class method: callable on either the class or an instance. we stay consistent. ⭐
  • $cipher->encrypt(PLAINTEXT) β€” PLAINTEXT must be exactly eight octets. like, exactly. the block gets encrypted, and the ciphertext comes back to you. πŸ¦‹
  • $cipher->decrypt(CIPHERTEXT) β€” CIPHERTEXT must be exactly eight octets. same deal, reversed. the block gets decrypted, and the plaintext is returned. πŸ”₯
  • $cipher->p_array and $cipher->s_boxes β€” these two extract the subkeys from the keyed cipher. ngl, this is not required for ordinary operation at all β€” it's the little backstage moment. see the superclass Crypt::Eksblowfish::Subkeyed for the details. πŸ’…
  • $cipher->is_weak β€” checks whether the cipher has been keyed with a weak key. you may desire to avoid using weak keys (very fair, bestie), and again, the superclass Crypt::Eksblowfish::Subkeyed has the details. πŸ’€

🌈 SEE ALSO 🌈

like the whole friend group. go say hi. 🫢


⭐ AUTHOR ⭐

the Eksblowfish guts were originally by Solar Designer (solar at openwall.com). the modifications and the Perl interface are by Andrew Main (Zefram) <zefram@fysh.org>. legends, both. πŸ‘‘


Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Andrew Main (Zefram) <zefram@fysh.org>

the original Eksblowfish code β€” the one in the form of crypt(), from which this module is derived β€” is in the public domain. you can find it at <http://www.openwall.com/crypt/>. free as a bird, fr fr. πŸ•ŠοΈ


πŸ’– LICENSE πŸ’–

this module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. periodt.


and that's the page, bestie πŸŽ€ β€” that was the Crypt::Eksblowfish::Blowfish manual from perl v5.42.3, dated 2026-08-19, straight out of the User Contributed Perl Documentation. go forth and encrypt your little 8-octet heart out. mwah πŸ’…βœ¨

πŸ“¦ where this page comes from