Discussion:
Seriation
Add Reply
Stefan Claas
2024-12-07 15:27:21 UTC
Reply
Permalink
$ echo "Hello sci.crypt community. This is a test with seriation." | seriation
Preprocessed text in lines:

HELLOSCICRYPTCOMMUNIT
YTHISISATESTWITHSERIA
TI
ON

Seriation:

HY ET LH LI OS SI CS IA CT RE YS PT TW CI OT MH MS UE NR II TA
TO IN

Seriation was used in the German WWII cipher Doppelkastenschlüssel
and I thought it is pretty cool. However, I did not managed yet to
understand how encryption and decryption works.
--
Regards
Stefan
Peter Fairbrother
2024-12-07 21:40:16 UTC
Reply
Permalink
Seriation is not a cipher, it is a technique used to build ciphers. Like
substitution and permutation, of which it is a form of the latter.

It can be useful eg with digram-based ciphers like Playfair, where it
makes cryptanalysis based on the known frequency of occurrence of
digrams in the plaintext language much harder or impossible.

Peter Fairbrother
Post by Stefan Claas
$ echo "Hello sci.crypt community. This is a test with seriation." | seriation
HELLOSCICRYPTCOMMUNIT
YTHISISATESTWITHSERIA
TI
ON
HY ET LH LI OS SI CS IA CT RE YS PT TW CI OT MH MS UE NR II TA
TO IN
Seriation was used in the German WWII cipher Doppelkastenschlüssel
and I thought it is pretty cool. However, I did not managed yet to
understand how encryption and decryption works.
Stefan Claas
2024-12-08 00:22:11 UTC
Reply
Permalink
Post by Peter Fairbrother
Seriation is not a cipher, it is a technique used to build ciphers. Like
substitution and permutation, of which it is a form of the latter.
It can be useful eg with digram-based ciphers like Playfair, where it
makes cryptanalysis based on the known frequency of occurrence of
digrams in the plaintext language much harder or impossible.
Yes, thank you for the explanation! It could also be a nice replacement
for SCOS, here in sci.crypt, combined with an A-Z encoder/decoder and a
padding program, since SCOS was cracked and floating around on Bitmessage
and code for seriation I have not seen yet elsewhere.

As an example:

$ echo "I wish the sci.crypt community a nice weekend!" | pad -p 64 \
| az -l 16 > message.txt

$ cat message.txt

UJCQXHGZXDGYSAHU
WIGVSAHTWDGZSOGT
XCHZXAHUSAGTWPGN
WNHVWOGZXEHZSAGR
SAGOWJGTWFCQXHGV
WFGLWFGOWECRQKES
VJFXUJFSVKEOVEER
QJAQQAAQQAAQQAAQ

$ seriation < message.txt

UW JI CG QV XS HA GH ZT XW DD GG YZ SS AO HG UT
XW CN HH ZV XW AO HG UZ SX AE GH TZ WS PA GG NR
SW AF GG OL WW JF GG TO WW FE CC QR XQ HK GE VS
VQ JJ FA XQ UQ JA FA SQ VQ KA EA OQ VQ EA EA RQ

Maybe worth a little challenge, to have such a
format for sci.crypt, with an AZ encoder, a pad
and seriation program. :-)
--
Regards
Stefan

P.S. I have figured out the encryption/decrption
process for Doppelkastenschlüssel. :-) (Did not
had enough coffee ... :-D)
Rich
2024-12-08 05:58:45 UTC
Reply
Permalink
Post by Stefan Claas
Post by Peter Fairbrother
Seriation is not a cipher, it is a technique used to build ciphers. Like
substitution and permutation, of which it is a form of the latter.
It can be useful eg with digram-based ciphers like Playfair, where it
makes cryptanalysis based on the known frequency of occurrence of
digrams in the plaintext language much harder or impossible.
Yes, thank you for the explanation! It could also be a nice replacement
for SCOS, here in sci.crypt, combined with an A-Z encoder/decoder and a
padding program, since SCOS was cracked and floating around on Bitmessage
and code for seriation I have not seen yet elsewhere.
SCOS was never meant to be in any way 'secure'. Hense the name: (S)ci
(C)rypt (O)pen (S)ecret. It was meant as a fun exercise at
cryptanalysis and working out a crypt/decrypt algorithm given examples
of encrypted messages.
Post by Stefan Claas
Maybe worth a little challenge, to have such a format for sci.crypt,
with an AZ encoder, a pad and seriation program. :-)
And why would you think it would not also eventually be "cracked" and
"floating around on bitmessage" after some time?
Stefan Claas
2024-12-08 11:48:28 UTC
Reply
Permalink
Post by Rich
And why would you think it would not also eventually be "cracked" and
"floating around on bitmessage" after some time?
I do not think that, I only propose something else to use.
--
Regards
Stefan
Rich
2024-12-08 16:05:56 UTC
Reply
Permalink
Post by Stefan Claas
Post by Rich
And why would you think it would not also eventually be "cracked" and
"floating around on bitmessage" after some time?
I do not think that, I only propose something else to use.
Ok, fair enough. But does it add anything of value over SCOS? SCOS's
'value' was in the practice of analysis and working out the algorithm
given just the encrypted messages (plus an 'oracle' who would encrypt
requested messages).

The actual 'obsfucation' factor was secondary.
Stefan Claas
2024-12-08 17:10:49 UTC
Reply
Permalink
Post by Rich
Post by Stefan Claas
Post by Rich
And why would you think it would not also eventually be "cracked" and
"floating around on bitmessage" after some time?
I do not think that, I only propose something else to use.
Ok, fair enough. But does it add anything of value over SCOS? SCOS's
'value' was in the practice of analysis and working out the algorithm
given just the encrypted messages (plus an 'oracle' who would encrypt
requested messages).
The actual 'obsfucation' factor was secondary.
To make it short, SCOS is dead and I liked to propose something
new for the community, so that we have more traffic here.
--
Regards
Stefan
Stefan Claas
2024-12-08 15:16:24 UTC
Reply
Permalink
Post by Stefan Claas
Maybe worth a little challenge, to have such a
format for sci.crypt, with an AZ encoder, a pad
and seriation program. :-)
Another example message: :-)

$ echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" | pad -p 80 | az -l 8 | seriation

UW IP GG VV WX MG GG MV
XW CF HE ZZ WX PH GG OZ
XX DF GG YR XW JM GG PM
WW BF GF OT WX JF GG TO
WQ EK GE RO XV JD CF RW
VV GI FE RP VU HK EE MZ
UV FH EE MO VV KB FE TY
VU AM EE MW UU DG EF PT
UV OF EF MT VU IF EF UW
SQ DA AA QQ QQ AA AA QQ
--
Regards
Stefan
Stefan Claas
2024-12-08 15:19:23 UTC
Reply
Permalink
Post by Stefan Claas
Post by Stefan Claas
Maybe worth a little challenge, to have such a
format for sci.crypt, with an AZ encoder, a pad
and seriation program. :-)
Another example message: :-)
$ echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" | pad -p 80 | az -l 8 | seriation
UW IP GG VV WX MG GG MV
XW CF HE ZZ WX PH GG OZ
XX DF GG YR XW JM GG PM
WW BF GF OT WX JF GG TO
WQ EK GE RO XV JD CF RW
VV GI FE RP VU HK EE MZ
UV FH EE MO VV KB FE TY
VU AM EE MW UU DG EF PT
UV OF EF MT VU IF EF UW
SQ DA AA QQ QQ AA AA QQ
Same message with pad -p 320 and az -l 16 settings:

UX IC GH VZ WW MP GG MO WW PF GE VZ XX GH GG VZ
XW DB GG YO XW JJ GG PT XW FF GF RT WX MF GG MO
WU EG GE RU XU JK CE RP QV KG EF OQ UV EF EF ZU
VU BD EF RY UV CF EE LW VU JF EF TS UU MB EE NR
VV HA EE LZ VU BI FE QN VV IA EF WV UU JB FE ZM
UV OG EF RX VU BL EE YK UU EI EF VQ VV DC FE ZM
UU DO EF SS VV KH EE LX UU BM FF XY UU LN FF TT
UV OB EF PY UU OM FF UY UU FE EF RV UV CG EF YX
VU EN EF VT VV AF EF KS UV FF EF RS UU PD EE OM
VV JA EE NP VU HC FE VO VU CD EE XS VV HE FF QK
VV HB EE ZN VV KE EE OL VV EC FE ZN VU EF EE SO
UU GG EF LT VV CB FF SK VV BB EE MK UV PA FF TS
UU JO FF VR VV HF EE XP VU HN FF ZZ UV GG FF XW
VU BK EF OS UU OO EF NR UU LI EE OK VU FC FF QU
UU FD FE UL VU BI EE VZ VV JE FE ZR VV KI FE KK
UV CC FF QW UU KF EF RY UV HC EE PT UV IC EF OV
UU FC EF OK UU OJ EE MY UV DJ EF PX UU JO EE TL
VU HC FF RS VV IC EE ZZ VU GH EE PM VV IK FE SZ
UU NN FE QM VV IK EF XY VV DB EE LU UU PL FE XV
UR GD FA XR UQ FA FA VQ UQ HA EA NQ UQ PA EA TQ
--
Regards
Stefan
Peter Fairbrother
2024-12-08 18:21:25 UTC
Reply
Permalink
Post by Stefan Claas
Seriation was used in the German WWII cipher Doppelkastenschlüssel
and I thought it is pretty cool. However, I did not managed yet to
understand how encryption and decryption works.
Doppelkastenschlüssel was a hand cipher of the type known as double
Playfair, or horizontal two square, used by the German Army throughout
WW2 as a field cipher.

It works pretty much like Playfair except there are two 5x5 Polybius
squares; the first letter of a plaintext digraph goes in the left square
and the second letter goes in the right square. As in Playfair, the
opposite corners of the rectangle form the ciphertext, with the letter
from the right hand box first.

If both letters were on the same horizontal line the previous letters in
the line were used, also usually with the letter from the right hand box
first.

The squares were random, not based on keywords (so they seldom ended
XYZ), and were distributed using a key network.

21-letter (usually) seriation was used to make both digraph frequency
analysis and transparency analysis harder.

Cascaded substitution, where the results of the digraph substitution
were used as inputs to a second substitution, was also used (sometimes).

It was broken by both US and UK cryptanalysts:

media.defense.gov/2021/Jun/29/2002751757/-1/-1/0/WORLD_WAR_II.PDF


A similar two-square cypher was also used by the Germans later in WW1,
but based on keywords and without seriation.



Peter Fairbrother
Stefan Claas
2024-12-08 19:52:54 UTC
Reply
Permalink
Post by Peter Fairbrother
Post by Stefan Claas
Seriation was used in the German WWII cipher Doppelkastenschlüssel
and I thought it is pretty cool. However, I did not managed yet to
understand how encryption and decryption works.
Doppelkastenschlüssel was a hand cipher of the type known as double
Playfair, or horizontal two square, used by the German Army throughout
WW2 as a field cipher.
It works pretty much like Playfair except there are two 5x5 Polybius
squares; the first letter of a plaintext digraph goes in the left square
and the second letter goes in the right square. As in Playfair, the
opposite corners of the rectangle form the ciphertext, with the letter
from the right hand box first.
If both letters were on the same horizontal line the previous letters in
the line were used, also usually with the letter from the right hand box
first.
The squares were random, not based on keywords (so they seldom ended
XYZ), and were distributed using a key network.
21-letter (usually) seriation was used to make both digraph frequency
analysis and transparency analysis harder.
According to the German WWII documentaion 17-letters per two lines,
a blank line and then again 17-letters per two lines and so on.
Post by Peter Fairbrother
Cascaded substitution, where the results of the digraph substitution
were used as inputs to a second substitution, was also used (sometimes).
media.defense.gov/2021/Jun/29/2002751757/-1/-1/0/WORLD_WAR_II.PDF
A similar two-square cypher was also used by the Germans later in WW1,
but based on keywords and without seriation.
Thanks for the info. I have read the following German docs, one original
from WWII[1] and the Wikipedia[2] article.

[1] <https://cryptocellar.org/wmc/schluesselanleitung-dk-1940.pdf>
[2] <https://de.wikipedia.org/wiki/Doppelkastenschl%C3%BCssel>

Interesting also Klaus Schmeh's articles on this subject.

<https://scienceblogs.de/klausis-krypto-kolumne/tag/doppelkasten-schluessel/>
--
Regards
Stefan
Peter Fairbrother
2024-12-08 23:22:00 UTC
Reply
Permalink
Post by Peter Fairbrother
21-letter (usually) seriation was used to make both digraph frequency
analysis and transparency analysis harder.
According to the German WWII documentation 17-letters per two lines,
a blank line and then again 17-letters per two lines and so on.
There were variations, but the Army and most others used 21 letters. I
don't know what the blank lines were.

Peter Fairbrother
Stefan Claas
2024-12-09 17:29:32 UTC
Reply
Permalink
Post by Peter Fairbrother
Post by Peter Fairbrother
21-letter (usually) seriation was used to make both digraph frequency
analysis and transparency analysis harder.
According to the German WWII documentation 17-letters per two lines,
a blank line and then again 17-letters per two lines and so on.
There were variations, but the Army and most others used 21 letters. I
don't know what the blank lines were.
Well, the reason for the blank line are IIRC not explained in the docs.

Anyways, I came up now with the idea to use hex values, so that
we may come up with some programs, for use in sci.crypt ... :-)

$ echo -n 'Hello sci.crypt! :-)' | xxd -ps | dkhf
48656C6C6F207363
692E637279707421
203A
2D29

$ echo -n 'Hello sci.crypt! :-)' | xxd -ps | dkhf | seriation
46 89 62 5E 66 C3 67 C2 67 F9 27 00 77 34 62 31
22 0D 32 A9

$ dokahex
Tagesschlüssel für den 09.12.2024 (UTC)

Tagesschlüssel 1:
Kasten: A Kasten: B
0 4 6 A 6 9 E 3
F 1 3 E 7 2 4 D
7 C D 5 1 C 0 5
B 2 9 8 F 8 A B

And to simplify the encryption/decryption process, we could
do it this way. We only mirror from a -> b and b -> a, like:

With the seriation from above and the example box a and b:

Ciphertext: 90 B4 E1 etc.

This doublebox hex variation with only mirroring is IMHO
easy and would allow to transmit small binary blobs. :-)
--
Regards
Stefan
Stefan Claas
2024-12-10 00:48:13 UTC
Reply
Permalink
Post by Stefan Claas
Anyways, I came up now with the idea to use hex values, so that
we may come up with some programs, for use in sci.crypt ... :-)
$ echo -n 'Hello sci.crypt! :-)' | xxd -ps | dkhf
48656C6C6F207363
692E637279707421
203A
2D29
$ echo -n 'Hello sci.crypt! :-)' | xxd -ps | dkhf | seriation
46 89 62 5E 66 C3 67 C2 67 F9 27 00 77 34 62 31
22 0D 32 A9
To bring messages in the right hex format for seriation, which
can be a bit tricky, I suggest to use padding (multiple of 16
bytes) on the original message(s), prior converting to hex and
seriation.

This guarantees that seriation always works properly.

And padding is in general good practice.
--
Regards
Stefan
Stefan Claas
2024-12-10 00:52:45 UTC
Reply
Permalink
Post by Stefan Claas
Post by Stefan Claas
Anyways, I came up now with the idea to use hex values, so that
we may come up with some programs, for use in sci.crypt ... :-)
$ echo -n 'Hello sci.crypt! :-)' | xxd -ps | dkhf
48656C6C6F207363
692E637279707421
203A
2D29
$ echo -n 'Hello sci.crypt! :-)' | xxd -ps | dkhf | seriation
46 89 62 5E 66 C3 67 C2 67 F9 27 00 77 34 62 31
22 0D 32 A9
To bring messages in the right hex format for seriation, which
can be a bit tricky, I suggest to use padding to the nearest
multiple of 16 bytes on the original message(s), prior converting
to hex and seriation.
Corrected above text.
--
Regards
Stefan
Stefan Claas
2024-12-10 21:12:53 UTC
Reply
Permalink
Post by Stefan Claas
$ echo -n 'Hello sci.crypt! :-)' | xxd -ps | dkhf
48656C6C6F207363
692E637279707421
203A
2D29
$ echo -n 'Hello sci.crypt! :-)' | xxd -ps | dkhf | seriation
46 89 62 5E 66 C3 67 C2 67 F9 27 00 77 34 62 31
22 0D 32 A9
$ dokahex
Tagesschlüssel für den 09.12.2024 (UTC)
Kasten: A Kasten: B
0 4 6 A 6 9 E 3
F 1 3 E 7 2 4 D
7 C D 5 1 C 0 5
B 2 9 8 F 8 A B
And to simplify the encryption/decryption process, we could
Ciphertext: 90 B4 E1 etc.
This doublebox hex variation with only mirroring is IMHO
easy and would allow to transmit small binary blobs. :-)
I have now four programs ready. :-)

1. dkh (Doppelkasten Hex = doublebox hex)
2. dks (Doppelkasten Seration = doublebox seriation)
3. dkt (Doppelkasten Tagesschlüssel = doublebox daily keys)
4. dkk (Doppelkasten Krypto = doublebox crypto)

dkh takes an input file from stdin and pads it with 16 bytes
and produces always equal number of lines, due to padding, with
an output of 8 hex values per line. dks does then the seriation
and produces 16 hex bytes per line, with spaces between the values.

dkt produces n numbers of keys A and B per day, UTC time. With
a second version (for private use and not for sci.crpt) one can
generate the keys with a password and salt.

Finally dkk does the automatic encryption from the dks file and
with a -d parameter the decryption, while using the produced key
files from dkt.

In the next couple of days I like then to run a Christmas Challenge,
with a given cipher message, to see how fast your rig can crack the
provided encrypted message. There are small prices for the Winner
and Runner-Up. I like to do this because I like to see how fast can
such messages been cracked, while I for myself do not do cryptanalysis
and leave it to the experts like you.
--
Regards
Stefan
Stefan Claas
2024-12-10 22:35:16 UTC
Reply
Permalink
Post by Stefan Claas
Post by Stefan Claas
$ echo -n 'Hello sci.crypt! :-)' | xxd -ps | dkhf
48656C6C6F207363
692E637279707421
203A
2D29
$ echo -n 'Hello sci.crypt! :-)' | xxd -ps | dkhf | seriation
46 89 62 5E 66 C3 67 C2 67 F9 27 00 77 34 62 31
22 0D 32 A9
$ dokahex
Tagesschlüssel für den 09.12.2024 (UTC)
Kasten: A Kasten: B
0 4 6 A 6 9 E 3
F 1 3 E 7 2 4 D
7 C D 5 1 C 0 5
B 2 9 8 F 8 A B
And to simplify the encryption/decryption process, we could
Ciphertext: 90 B4 E1 etc.
This doublebox hex variation with only mirroring is IMHO
easy and would allow to transmit small binary blobs. :-)
I have now four programs ready. :-)
1. dkh (Doppelkasten Hex = doublebox hex)
2. dks (Doppelkasten Seration = doublebox seriation)
3. dkt (Doppelkasten Tagesschlüssel = doublebox daily keys)
4. dkk (Doppelkasten Krypto = doublebox crypto)
Sample run with yesterdays's message and today's keys:

$ echo -n 'Hello sci.crypt! :-)' | dkh > message.txt

$ cat message.txt
48656C6C6F207363
692E637279707421
203A2D294A53594F
4848575350535A44

$ dks < message.txt > seriation.txt

$ cat seriation.txt
46 89 62 5E 66 C3 67 C2 67 F9 27 00 77 34 62 31
24 08 34 A8 25 D7 25 93 45 A0 55 33 55 9A 44 F4

$ dkk -k keys.txt < seriation.txt > ciphertext.txt

$ cat ciphertext.txt
06 2B 68 8E 66 4D 62 48 62 AB 72 C4 F2 5C 68 59
7C C5 5C B5 73 32 73 1D 03 B4 83 5D 83 1F 0C AC

$ cat keys.txt
Daily Keys for Dec.10.2024 (UTC)

Daily Keys 1:
Box: A Box: B
A B 8 3 B 9 2 5
7 E 0 4 F E C 0
C 1 F 9 4 D A 1
6 D 2 5 6 3 7 8
--
Regards
Stefan
Stefan Claas
2024-12-14 14:56:05 UTC
Reply
Permalink
Post by Stefan Claas
Post by Stefan Claas
$ echo -n 'Hello sci.crypt! :-)' | xxd -ps | dkhf
48656C6C6F207363
692E637279707421
203A
2D29
$ echo -n 'Hello sci.crypt! :-)' | xxd -ps | dkhf | seriation
46 89 62 5E 66 C3 67 C2 67 F9 27 00 77 34 62 31
22 0D 32 A9
$ dokahex
Tagesschlüssel für den 09.12.2024 (UTC)
Kasten: A Kasten: B
0 4 6 A 6 9 E 3
F 1 3 E 7 2 4 D
7 C D 5 1 C 0 5
B 2 9 8 F 8 A B
And to simplify the encryption/decryption process, we could
Ciphertext: 90 B4 E1 etc.
This doublebox hex variation with only mirroring is IMHO
easy and would allow to transmit small binary blobs. :-)
I have now four programs ready. :-)
1. dkh (Doppelkasten Hex = doublebox hex)
2. dks (Doppelkasten Seration = doublebox seriation)
3. dkt (Doppelkasten Tagesschlüssel = doublebox daily keys)
4. dkk (Doppelkasten Krypto = doublebox crypto)
Added dkt+, with -p for password and -s for salt parameter, so
that it can be used outside of sci.crypt. :-)

Additionally dkk can now use key sequences, like -s 23,5,17 etc.,
for using mutliple keys, thus making it harder to crack. Default
is to use keys 1,2 from the daily list.

Example run:

$ echo -n 'Hello sci.crypt! :-)' | dkh > message.txt
$ cat message.txt
48656C6C6F207363
692E637279707421
203A2D2946584256
4E465A5A4E535A59

$ dks < message.txt > seriation.txt
$ cat seriation.txt
46 89 62 5E 66 C3 67 C2 67 F9 27 00 77 34 62 31
24 0E 34 A6 25 DA 25 9A 44 6E 55 83 45 2A 55 69

$ dkk -s 5,1,3 < seriation.txt > ciphertext.txt
$ cat ciphertext.txt
C0 AF 9B 79 90 24 97 2B 97 1F 47 EE F7 5D 9B 5A
4D E9 5D D0 42 38 42 B8 CD 99 72 A4 C2 48 72 9F

$ cat keys.txt
Tagesschlüssel für den 14.12.2024 (UTC)

Tagesschlüssel 1:
Kasten: A Kasten: B
5 2 7 B C B F 5
0 E 6 A 6 1 2 D
F 9 C 3 7 E 8 3
4 D 1 8 4 9 0 A

Tagesschlüssel 2:
Kasten: A Kasten: B
3 9 1 B 6 9 B 5
C 4 D F E 4 2 1
E A 7 2 A C 0 F
0 6 8 5 7 D 3 8

Tagesschlüssel 3:
Kasten: A Kasten: B
4 A F 8 E 9 3 7
1 6 D 5 C 2 1 0
2 C E 0 D B 5 8
B 9 7 3 F 4 A 6

Tagesschlüssel 4:
Kasten: A Kasten: B
5 B F 0 E F 4 2
2 E D 9 6 0 B 1
1 C 3 7 3 A C 9
6 8 A 4 8 5 D 7

Tagesschlüssel 5:
Kasten: A Kasten: B
7 1 D A 2 3 7 6
3 B 2 5 9 B D C
E 8 0 9 1 F 4 5
C F 4 6 0 A E 8
--
Regards
Stefan
Stefan Claas
2024-12-15 17:18:43 UTC
Reply
Permalink
Post by Stefan Claas
Added dkt+, with -p for password and -s for salt parameter, so
that it can be used outside of sci.crypt. :-)
Additionally dkk can now use key sequences, like -s 23,5,17 etc.,
for using mutliple keys, thus making it harder to crack. Default
is to use keys 1,2 from the daily list.
Uploaded to GitHub.

<https://github.com/706f6c6c7578/Doppelkastenschluessel-Hex>
--
Regards
Stefan
Loading...