Crypt:...owfish(3pm)

🫢 NAME 🫢

Crypt::Eksblowfish β€” the Eksblowfish block cipher, bestie πŸ’–


✨ SYNOPSIS ✨

use Crypt::Eksblowfish;

$block_size = Crypt::Eksblowfish->blocksize;

$cipher = Crypt::Eksblowfish->new(8, $salt, $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) { ...

🌸 DESCRIPTION 🌸

okay so picture this: an object of this type encapsulates a keyed instance of the Eksblowfish block cipher, and it's sitting there all ready to encrypt and decrypt. πŸ’…

Eksblowfish is a variant of the Blowfish cipher that got modified so that the key setup is very expensive. and bestie, "Eks" literally stands for "expensive key schedule". πŸ’Έ

the tea though: this doesn't make it significantly cryptographically stronger. it's just intended to hinder brute-force attacks. it also makes it unsuitable for any application requiring key agility. it was designed by Niels Provos and David Mazieres for password hashing in OpenBSD. 🌈 check Crypt::Eksblowfish::Bcrypt for the hash algorithm, and Crypt::Eksblowfish::Blowfish for the unmodified Blowfish cipher. πŸ”₯

Eksblowfish is a parameterised (family-keyed) cipher. it takes a cost parameter that controls how expensive the key scheduling is. it also takes a family key, known as the "salt". cost and salt parameters together define a cipher family. within each family, a key determines an encryption function in the usual way. see Crypt::Eksblowfish::Family for a way to encapsulate an Eksblowfish cipher family. ✨


πŸ‘‘ CLASS METHODS πŸ‘‘

Crypt::Eksblowfish->blocksize

returns 8, indicating the Eksblowfish block size of 8 octets. and the serve is that this method may be called on either the class or an instance. πŸŽ€


πŸŽ€ CONSTRUCTOR πŸŽ€

Crypt::Eksblowfish->new(COST, SALT, KEY)

performs key setup on a new instance of the Eksblowfish algorithm, and hands you back the keyed state. 🫢

the KEY may be any length from 1 octet to 72 octets inclusive. the SALT is a family key, and it must be exactly 16 octets β€” no more, no less, she's picky. COST is an integer parameter controlling the expense of keying: the number of operations in key setup is proportional to 2^COST. all three parameters influence all the subkeys, and changing any of them produces a different encryption function. πŸ’₯

lowkey important: due to the mandatory family-keying parameters (COST and SALT), this constructor does not match the interface expected by Crypt::CBC and similar crypto plumbing modules. 😭

to use Eksblowfish with them it is necessary to have an object that encapsulates a cipher family and provides a constructor that takes only a key argument. that facility is supplied by Crypt::Eksblowfish::Family. πŸ’–


πŸ’œ METHODS πŸ’œ

$cipher->blocksize

returns 8, indicating the Eksblowfish block size of 8 octets. this method may be called on either the class or an instance. πŸ’«

$cipher->encrypt(PLAINTEXT)

PLAINTEXT must be exactly eight octets. the block is encrypted, and the ciphertext is returned. ⭐

$cipher->decrypt(CIPHERTEXT)

CIPHERTEXT must be exactly eight octets. the block is decrypted, and the plaintext is returned. 🌸

$cipher->p_array and $cipher->s_boxes

these methods extract the subkeys from the keyed cipher. ngl this is not required in ordinary operation. see the superclass Crypt::Eksblowfish::Subkeyed for details. πŸ¦‹

$cipher->is_weak

this method checks whether the cipher has been keyed with a weak key. it may be desired to avoid using weak keys. see the superclass Crypt::Eksblowfish::Subkeyed for details. πŸ™ˆ


πŸ” SEE ALSO πŸ”


✍️ AUTHOR ✍️

Eksblowfish guts originally by Solar Designer (solar at openwall.com). 🧚

modifications and Perl interface by Andrew Main (Zefram) zefram@fysh.org. πŸ‘‘


Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Andrew Main (Zefram) zefram@fysh.org πŸ’œ

the original Eksblowfish code (in the form of crypt()) from which this module is derived is in the public domain. it may be found at http://www.openwall.com/crypt/. πŸ“


πŸ“œ LICENSE πŸ“œ

this module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. slay, honestly. πŸ’…


aaaand that's the whole vibe check, bestie β€” this page ships with perl v5.42.3 and is dated 2026-08-19. go encrypt something cute πŸ¦‹βœ¨

πŸ“¦ where this page comes from