Crypt::DES_EDE3(3pm)

πŸ’– Crypt::DES_EDE3 πŸ’–

okay bestie, so this is a page from the User Contributed Perl Documentation and it's literally all about Crypt::DES_EDE3, which lives in section 3pm of the manual (that's the Perl module section, iykyk). pull up a chair, grab a strawberry, we're doing crypto ✨


🌸 NAME 🌸

Crypt::DES_EDE3 β€” Triple-DES EDE encryption/decryption. that's it, that's the name, and it ate πŸ’…


✨ SYNOPSIS ✨

here's the whole vibe in three lines, no cap:

use Crypt::DES_EDE3;
my $ede3 = Crypt::DES_EDE3->new($key);
$ede3->encrypt($block);

like... that's the entire relationship. use it, make it, encrypt with it πŸ¦‹


πŸ‘‘ DESCRIPTION πŸ‘‘

so Crypt::DES_EDE3 implements DES-EDE3 encryption. and what even is that? it's triple-DES encryption, where:

  • an encrypt operation is encrypt-decrypt-encrypt πŸ”₯
  • a decrypt operation is decrypt-encrypt-decrypt πŸ”„

this implementation is lowkey a delegator β€” it uses Crypt::DES to do its dirty DES work, and just wraps around that module. the wrapping is: setting up the individual DES ciphers, initializing the keys, and performing the encryption/decryption steps. that's the whole job. main character of a wrapper, honestly.

DES-EDE3 encryption requires a key size of 24 bytes. remember that number. it matters. periodt.

bestie, real talk: you're probably best off not using this module directly, because the encrypt and decrypt methods expect 8-octet blocks. like, just 8. that's a tiny little block. you might want to use this module in conjunction with Crypt::CBC, for example. that combo would be DES-EDE3-CBC, aka triple-DES in outer CBC mode. much more civilized πŸ’–

πŸŽ€ USAGE πŸŽ€

$ede3 = Crypt::DES_EDE3->new($key)

creates a new Crypt::DES_EDE3 object β€” and ngl, it's really a collection of three DES ciphers 🧚 β€” and initializes each cipher with part of $key.

$key should be at least 24 bytes. and if it's longer than 24 bytes? the extra bytes will be ignored. not deleted, not punished, just... ignored πŸ™ˆ

returns the new object. slay.


$ede3->encrypt($block)

encrypts an 8-byte block of data $block using the three DES ciphers in an encrypt-decrypt-encrypt operation. that's the EDE, bestie, it's literally in the name πŸ’…

returns the encrypted block.


$ede3->decrypt($block)

decrypts an 8-byte block of data $block using the three DES ciphers in a decrypt-encrypt-decrypt operation. the mirror image. the reverse uno card πŸͺž

returns the decrypted block.


$ede3->blocksize

returns the block size, which is 8.

tiny block, big energy ⭐


$ede3->keysize

returns the key size, which is 24.

that's 24 bytes of pure security vibes 🌈


πŸ’œ LICENSE πŸ’œ

Crypt::DES_EDE3 is free software; you may redistribute it and/or modify it under the same terms as Perl itself. so like, go off, but respect the terms 🫢


πŸ’€ AUTHOR & COPYRIGHTS πŸ’€

Crypt::DES_EDE3 is Copyright 2001 Benjamin Trott, ben@rhumba.pair.com.

All rights reserved.


and that's the whole page, bestie πŸ’– no notes, iconic behavior from a triple-DES wrapper fr fr.

this page ships with perl v5.40.0 and it's dated 2024-11-16 β€” so when you're out here reading Crypt::DES_EDE3(3pm), just know you're reading a certified classic from the User Contributed Perl Documentation. bye babe, encrypt responsibly πŸŽ€βœ¨

πŸ“¦ where this page comes from