tcl::transform::otp(n)

πŸ“¦
version 2.0 Β· 2 versions
, in fedora 43, fedora 44, nixos 26.05, nixpkgs unstable

πŸ’– tcl::transform::otp(n) πŸ’–

okay bestie, so this page lives in the Reflected/virtual channel support corner of the tcllib manual, and it's about the tcl::transform::otp package. grab a snack, we're doing one-time pads 🌸


✨ NAME ✨

tcl::transform::otp β€” encryption via one-time pad. yes literally, the ✨unbreakable✨ one, if you do it right, which is a whole thing, but we're just here for the channel transform πŸ’…


✨ SYNOPSIS ✨

package require Tcl 8.6 9

package require tcl::transform::core ?1.1?

package require tcl::transform::otp ?1.1?

::tcl::transform::otp chan keychanw keychanr

✨ DESCRIPTION ✨

so the tcl::transform::otp package hands you a command that creates a channel transformation. that transform takes one-time pads that you supply from outside, and it uses them to encrypt stuff when you write, and decrypt stuff when you read. like a little bouncer at the door of your channel, but the bouncer is math 🫢

a related transformation hanging out in this same module is tcl::transform::rot.

and for the people who care about the plumbing: the internal TclOO class that actually implements the transform handler is a subclass of the tcl::transform::core framework. iconic inheritance moment πŸ‘‘


✨ API ✨

  • ::tcl::transform::otp chan keychanw keychanr β€” this is the one, bestie. it builds a one-time-pad-based encryption transformation sitting on top of the channel chan, and gives you back its handle. πŸŽ€

the two channels keychanw and keychanr hold the one-time pads for the write direction and the read direction, respectively. their contents get read, and then xored with the bytes you write to and read from the channel. that's the whole vibe: read key, xor, done. no cap ✨


🫠 BUGS, IDEAS, FEEDBACK 🫠

ngl, this document β€” and the package it describes β€” will undoubtedly contain bugs and other problems. like, absolutely. it's giving "we're all just doing our best" 😭

please report them in the category virtchannel of the Tcllib Trackers at [http://core.tcl.tk/tcllib/reportlist].

and while you're there: if you have ideas for enhancements for either the package and/or the documentation, please report those too. we want them fr fr πŸ’œ

when you propose code changes, please provide unified diffs, i.e. the output of diff -u. πŸ’…

also, heads up: attachments are strongly preferred over inlined patches. you make an attachment by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar. that's the move, that's the path, slay 🌈


✨ KEYWORDS ✨

channel transformation, cipher, decryption, encryption, one time pad, otp, reflected channel, tip 230, transformation, virtual channel, xor


✨ CATEGORY ✨

Channels


Copyright (c) 2009 Andreas Kupries <andreas_kupries@users.sourceforge.net>


ok so that's the whole page bestie, you ate it, go encrypt something responsibly πŸ’–

and a little sign-off for the footer stans: this page came to you from tcllib, version 1.1, and it's the tcl::transform::otp(n) page. mwah πŸŽ€πŸ’–βœ¨

πŸ“¦ where this page comes from