Sujet : Re: lun - Lucky Number
De : fgrsna.pynnf (at) *nospam* vagrearg.eh (Stefan Claas)
Groupes : sci.cryptDate : 09. Mar 2025, 11:21:30
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vqjq4b$m7pk$1@stefan.eternal-september.org>
References : 1 2 3 4 5 6
User-Agent : flnews/1.3.0pre29 (for GNU/Linux)
Richard Heathfield wrote:
On 08/03/2025 19:11, Stefan Claas wrote:
Well, Rich (and maybe you) should also show things to the community here,
which can be discussed, otherwise this place is getting pretty boring.
Okay. How about a new primitive? (I /think/ it's new, but of course
there's nothing new under the sun so I might be mistaken.)
Take 8 consecutive bytes, imagine them as a square of 8x8 bits, and
'tumbleweed' the bits clockwise.
That is, turn this:
abcdefgh
ijklmnop
qrstuvwx
yzABCDEF
GHIJKLMN
OPQRSTUV
WXYZ0123
456789+=
to this:
4WOGyqia
5XPHzrjb
6YQIAskc
7ZRJBtld
80SKCume
91TLDvnf
+2UMEwog
=3VNFxph
The inverse is of course to tumbleweed them anticlockwise.
Sort of gives a new spin to bit rotation.
This is a really nice idea! :-) I called my program 'spiro' since
it gives a 'spiral' like output. To fill the matrix properly it
uses padding.
$ spiro -h
Usage: spiro [OPTIONS] [TEXT]
Options:
-m SIZE Matrix size (must be power of 2, default: 8)
-r DEG Rotation degree (90, 180, 270, default: 90)
-f FILE Output/Input file name (optional for encoding)
-d Decode mode (requires -f)
Examples:
spiro -m 8 -r 90 "Hello World"
spiro -m 8 -r 90 -f encoded.txt "Hello World"
spiro -m 8 -d -f encoded.txt
echo "Long text" | spiro -m 16 -r 90
$ echo ThankyouRichardfortheniceideathisisreallyfun | spiro -f out.txt
Encoded matrix:
niceideT
entwE3ah
huZg3Jta
tfKvffhn
ryQo9mik
ol36p8sy
flaersio
drahciRu
$ spiro -d -m 8 -f out.txt
Decoded text: ThankyouRichardfortheniceideathisisreallyfuntwE3Jfm8p63QKZg3f9ov
Regards
Stefan
-- Onion Courier Home Server Mon-Fri 15:00-21:00 UTC Sat-Sun 11:00-21:00 UTCohpmsq5ypuw5nagt2jidfyq72jvgw3fdvq37txhnm5rfbhwuosftzuyd.onion:8080 inbox age1yubikey1qv5z678j0apqhd4ng7p22g4da8vxy3q5uvthg6su76yj0y8v7wp5kvhstum