Net::SS...r::DES3(3)

πŸ“¦
version 2.144 Β· 4 versions
, in fedora 44

πŸ’– NAME πŸ’–

Net::SSH::Perl::Cipher::DES3 β€” bestie, it's the wrapper that gives you SSH 3DES support. That's it, that's the job. πŸ’…

(also hey, this is page Net::SS...r::DES3(3) from the User Contributed Perl Documentation section, just so you know where you are 🫢)


✨ SYNOPSIS ✨

okay so here's the whole vibe in four lines, no notes:

use Net::SSH::Perl::Cipher;
my $cipher = Net::SSH::Perl::Cipher->new('DES3', $key);
print $cipher->encrypt($plaintext);

that's it. that's the whole thing. iconic. 🌸


πŸ¦‹ DESCRIPTION πŸ¦‹

so Net::SSH::Perl::Cipher::DES3 is out here providing 3DES encryption support for Net::SSH::Perl. and the way it does that? it wraps around Crypt::Cipher::DES, which is the CryptX implementation of the DES algorithm. slay. ✨

now listen, the 3DES (three-key triple-DES) algorithm used here is lowkey different depending on which SSH protocol you're running. not me having two whole personalities. 😭

  • SSH1 uses 3DES in inner CBC mode. what does that mean bestie? it means there are three CBC objects, and each CBC object is paired with a DES object and a key. three of everything. a whole trio. πŸ‘‘
  • SSH2 uses 3DES in outer CBC mode. this one uses one CBC object wrapped around a DES-EDE3 object (also included in this library, don't worry she's in there), and that object contains three DES ciphers with three different keys. so every single encrypt operation is literally encrypt-decrypt-encrypt with the three DES keys, and decrypt is literally decrypt-encrypt-decrypt with the DES keys. it's giving choreography. πŸ’ƒ

now for the tea on keys: the key length for both implementations is 24 bytes. the first 8 bytes of the key get used as the first DES key, the second 8 bytes for the second key, etc. etc. etc. πŸ“

but wait β€” plot twist πŸ™ˆ β€” if the key $key you pass to new is only 16 bytes, then the first 8 bytes of $key get used as the key for both the first and third DES ciphers. she's recycling. we love a sustainable queen. ♻️

πŸ‘‘ AUTHOR & COPYRIGHTS πŸ‘‘

pls go read the Net::SSH::Perl manpage for all the author, copyright, and license info, because that's where the receipts live. i'm just the messenger. 🫢


and that's the page bestie!! 🌈 this little gem is from perl v5.42.0, dated 2026-01-17, and it's part of the User Contributed Perl Documentation. go forth and encrypt responsibly. mwah. πŸ’–πŸŽ€πŸ§š

πŸ“¦ where this page comes from