Discussion:
an scos2 test...
(too old to reply)
Chris M. Thomasson
2024-07-25 22:17:50 UTC
Permalink
I dug up my old impl of scos2. Does this work for you?

scos2 247 742

*,B|A D@[>+i p"= ;_{ )3xy $yx5 ojts wihkb#

KWNYTZ JYFQV,H.Nw

rXZ
Chris M. Thomasson
2024-07-25 22:27:46 UTC
Permalink
Post by Chris M. Thomasson
I dug up my old impl of scos2. Does this work for you?
scos2 247 742
KWNYTZ JYFQV,H.Nw
rXZ
I finally found the original SCOS2 code! Here it is:

scos2 712 901


v^qC{3J= MeCyaDVf5
TmO&vb=u [C&WB!a5&A
3=yK;"R@ UmK-iK&AKk
\R?uaG1Z 46uW[l%{I

"[xV>$a ~uR)2 _-sQ'1Z<!iG_rP~0Y,9hF)qO#zXg
ThF)sU{ bB+aK b2a\"jH-sQ'1Z<!iG_rP~0Y,9hF'
*@2aA(f *sN#9 }kI+***@2a\"k
XlJ=wY# jL*cQ fBBlJ=uS;3b|$kI+***@2a\"jH-sQ'1Z<9h*

3(pN~4S 8kC[ xP#nX '3i~$ V<7gO =yO&3

?H-sS.x /-dP kHnN}ox.wk#8WfiK(z+ u \#

7+tR:8W 8 ~
[\"jJ]o [ Y(

fDwm\4 kK+l H~2K}?Z|!a OZ lL=m P&91
d
^W.9Z j# \ YN
@
b W. W=*+
l
+dB*g q? D1 'oia
C
o iH j.'?
y
'nZ<6Z GL
*

<^r H7mOPsU< qe;y@ /9ZNJ+ C;rdX
|
Q|!mK 5h<] iV_58g | <^gOx
6pL~0 G{nb ["UGJ= p nP=4 Q/zh*

;z 8'(d, b 6s
U
rT, 1a#z ^ g1pB~'cY.he <9 n0=i V D 2 l>
N~yO ~4h >1s/3sB Q yW:5X:.PD4qr:#9 ***@1J lH,+
\%j| %pS +md[1N e $kF_lFIdR)45GA{ "pD&X zVK.
M#xN +yc g =}
K&rE^sG( nP-8 Q/N
W\3rn -uF W ZD6d-
<$i\ _pQ R 79
#1X~ 3UL G wy

&gX$iX+ > Q,"T/Ch\@***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> ) c L!
~2Y' 2eH !bS7dS* ; Y,6f<69@)eQR61j XB4b} L="v
%nJ^ nP/ vMDzb~ E mK-tL-{D:sef+&x lP)p< Z>[9
#1X~ 3UL G g<'d|'m!
~2Y' wZD H xz
]qS-pT=s O;vj :8'
<^eSO vV+ < A_hEv
%nJ^ uQ: / ik
%V?8Y i8rB9juPoQr _] NU nL7jLN '0 C;
7
:xo aG I82/

H* [N.6a{wVf2emJ
]
P:2I[pdaxZhR
=
|)wF
V
vV+ < fD%V<_*\]jVk nPXH
W; |fF5 !t wa'0@
6
Post by Chris M. Thomasson
6h i 9j. J dQ^09
)vZ d 5e;3 $ k&gX J K<vh3n

4VM G_ E!1I[l"

]u 3>9V? I- %K
#
Q#2 2a SF3p}
o
(nO O# E=0%
.8W\*Zi|%|FC G/qcf7dEJ%x
N
fJ~l
1
;4S.$Ve>9>B\ B)]!
a
<
9
~9i,%q|IvT&nX.L xw83hR
=
|)wF
V
pW>yaD1!I+cA[w% Kfa-xS DziJ &oA% qH\nJ\w Z;=dF6|L~jMkpbF8j B^aG
{gB~mYlMY17TF}mN} vT&rT )2P F$aI5q J- wU*yb< > Z\zX . 6m\[3R/3_ {
uS~^sG=s6htoSC
7

<wiG&i SU
[
oc
Marcel Logen
2024-07-26 15:36:39 UTC
Permalink
Chris M. Thomasson in sci.crypt:

[...]
Post by Chris M. Thomasson
scos2 712 901
[...]

scos2 712 901
(" 1O: lN)2S~ ^Z? -YD) sG :rL "SB(} VE5d P=

<wT;2Z,8fC^lI-rO]xU:3a<9gD&mJ+sP#yV/4b\!hE*nK=tQ~zW?5c|"i
5mL^qT(]Y,sQA$' aZlgK.
z
(vZ{
\
S|%bD+en]yF)2Zq
~IDxa> +cL#8 P'pN ;wn~yn, ^fW)uGo0v
S"S>TYK'rS [xJ@ 6P["VHU>HC
^_[lXB4fB %l/9l >-h ***@sa{8 b< ^m?*tPE
* w ]zL} v S\zlP)tPf j G_oaE7iES?FA_3
T

yI.7b. _+
l
X*nK=tQ~zW?5c|"iF(oL{uR'0X.6dA$jG)pM}***@1Y>7eB%kH_qN[wT;2

D5i D4iL^d D%z D 7T}I{v E)h <)s Q$vWDHM >y

rW~wW/4eE8lHql]***@35Y"!cBjo=rqS0s/41b\hgB)l}tPL=YU~6b\7eAllL=tU2

:\=tM#<!hsa.$eESbG)hJ^***@z(~***@7;>=***@AHjY~FkjV5PBrT7}Bz4%t;jN>be!q|

~%1J{1
--
╮ ╭─╮ ╭────╮ ╭────╮ ..41..╭────────╮ ╭──────────
╰──╯ ╰─╮ ╭────╯ ╭─╯ ╭─╯ ╭─╯ │ ╭────╯ │ ..67..
╰─╮ ╭──╮ ╰───╮ ╰─╮ │ ╭─╯ ╭───────╮ │ ╰─╮ ╭─╮ ╭─╯ ..67..
╰─╯ ╰──────╯ ╰─╯ ╰───╯ ╰─╯ ╰──╯ ╰─╯ ..67..
Marcel Logen
2024-07-26 15:51:03 UTC
Permalink
Post by Chris M. Thomasson
[...]
Post by Chris M. Thomasson
scos2 712 901
[...]
scos2 712 901
Sorry, this should read:

/----------------------
(" 1O: lN)2S~ ^Z? -YD) sG :rL "SB(} VE5d P=

<wT;2Z,8fC^lI-rO]xU:3a<9gD&mJ+sP#yV/4b\!hE*nK=tQ~zW?5c|"i
5mL^qT(]Y,sQA$' aZlgK.
z
(vZ{
\
S|%bD+en]yF)2Zq
~IDxa> +cL#8 P'pN ;wn~yn, ^fW)uGo0v
S"S>TYK'rS [xJ@ 6P["VHU>HC
^_[lXB4fB %l/9l >-h ***@sa{8 b< ^m?*tPE
* w ]zL} v S\zlP)tPf j G_oaE7iES?FA_3
T

yI.7b. _+
l
X*nK=tQ~zW?5c|"iF(oL{uR'0X.6dA$jG)pM}***@1Y>7eB%kH_qN[wT;2

D5i D4iL^d D%z D 7T}I{v E)h <)s Q$vWDHM >y

rW~wW/4eE8lHql]***@35Y"!cBjo=rqS0s/41b\hgB)l}tPL=YU~6b\7eAllL=tU2

:\=tM#<!hsa.$eESbG)hJ^***@z(~***@7;>=***@AHjY~FkjV5PBrT7}Bz4%t;jN>be!q|
\----------------------

Marcel (Lines: 47)
--
╭────────╮ ╭─╮ ╭─╮ ╭─────╮ ╭─╮..49..╭──────╮ ╭──╮
...3..╭─╮ ╰─────╮ ╰──╯ ╰───╯ │ ╰───╮ ╰──╯ ╰─╮ ╭─╯ ╭──╮ │ │ │
╭───╮ │ │ ╭──────╯ ..28..╰───╮ ╰─╮ ╭───╯ ╰───╯ │ ╰─╯ │ ╭─
╭─╯ ╰─╯ ╰─╯ ╰────╯ ╰─────────────╯..61..╰───╯
Marcel Logen
2024-07-26 15:55:48 UTC
Permalink
Post by Marcel Logen
Post by Chris M. Thomasson
scos2 712 901
/----------------------
(" 1O: lN)2S~ ^Z? -YD) sG :rL "SB(} VE5d P=

<wT;2Z,8fC^lI-rO]xU:3a<9gD&mJ+sP#yV/4b\!hE*nK=tQ~zW?5c|"i
5mL^qT(]Y,sQA$' aZlgK.
z
(vZ{
\
S|%bD+en]yF)2Zq
~IDxa> +cL#8 P'pN ;wn~yn, ^fW)uGo0v
S"S>TYK'rS [xJ@ 6P["VHU>HC
^_[lXB4fB %l/9l >-h ***@sa{8 b< ^m?*tPE
* w ]zL} v S\zlP)tPf j G_oaE7iES?FA_3
T

yI.7b. _+
l
X*nK=tQ~zW?5c|"iF(oL{uR'0X.6dA$jG)pM}***@1Y>7eB%kH_qN[wT;2

D5i D4iL^d D%z D 7T}I{v E)h <)s Q$vWDHM >y
Post by Marcel Logen
\----------------------
Please note the indentation.

Marcel (Lines: 42)
--
╭───╮ ╭───╮ ╭────╮ ..67..
╰─╮ ╰─╮ ╭─╯ ╰──╮ ╭─╮ ╭─╮ ╭────╯ ╰─╮ ..67..
╮ ╰─╮ │ ╭─╮ ╭──╮ ╭───╮ ╭──╯ ╭─────╯ │ │ │ ╰─╯ ..57..╰────╮
╰────╯ ╰─╯ ╰───╯ ╰─╯ ╰─╯ ╰────────╯ ╰──╯ ..62..╰────
Marcel Logen
2024-07-26 16:03:37 UTC
Permalink
Post by Marcel Logen
Post by Chris M. Thomasson
scos2 712 901
/----------------------
(" 1O: lN)2S~ ^Z? -YD) sG :rL "SB(} VE5d P=

<wT;2Z,8fC^lI-rO]xU:3a<9gD&mJ+sP#yV/4b\!hE*nK=tQ~zW?5c|"i
5mL^qT(]Y,sQA$' aZlgK.
z
(vZ{
\
S|%bD+en]yF)2Zq
~IDxa> +cL#8 P'pN ;wn~yn, ^fW)uGo0v
S"S>TYK'rS [xJ@ 6P["VHU>HC
^_[lXB4fB %l/9l >-h ***@sa{8 b< ^m?*tPE
* w ]zL} v S\zlP)tPf j G_oaE7iES?FA_3
T

yI.7b. _+
l
X*nK=tQ~zW?5c|"iF(oL{uR'0X.6dA$jG)pM}***@1Y>7eB%kH_qN[wT;2

D5i D4iL^d D%z D 7T}I{v E)h <)s Q$vWDHM >y

rW~wW/4eE8lHql]***@35Y"!cBjo=rqS0s/41b\hgB)l}tPL=YU~6b\7eAllL=tU2

:\=tM#<!hsa.$eESbG)hJ^***@z(~***@7;>=***@AHjY~FkjV5PBrT7}Bz4%t;jN>be!q|
\----------------------
Post by Marcel Logen
Please note the indentation.
Oh, it's too hard for me! ;-)

Marcel (Lines: 45)
--
│ ╭──╮ ╭────╮ ╭───────╮ ╭─╮ ..61..╭──╮
╰─╮ ╭─╯ ╰─╯ ╰─╮ ╰────╮ ╰───╯ ╰──╮ ..57..╭───╯ ╰──
│ ╭───╮ ╭───╯ ╭──────╯ ╭─╮ ╰───╮ ╭────╯ ╭─╮ │ ..67..
╰─────╯ ╰──╯ ╰─────────╯ ╰───────╯ ╰──────╯ ╰───╯ ..67..
Chris M. Thomasson
2024-07-26 23:07:51 UTC
Permalink
Post by Chris M. Thomasson
[...]
Post by Chris M. Thomasson
scos2 712 901
[...]
scos2 712 901
[...]

1930...9f

?
Marcel Logen
2024-07-27 10:22:55 UTC
Permalink
[...]
Post by Chris M. Thomasson
1930...9f
?
That's OK.

But note: The indentation in the whole code is done by
two SPACEs per step. Exception: in the last "fprintf"
command.

Marcel (Lines: 24)
--
╭────╮ ╭────╮ ╭──╮ ╭───────╮ ╭─╮ ..67..
╭───╯ ╭─╯ ╰─╮ │ ╭─╯ ╰─╮ ╭─╮ ╭─╮ ╰─────╮ ╰─╯ ╰─╮ ╭───╮
│ ╰─╮ ╭─╯ ╰─╯ ╭─╯ │ ╰─╮ ╭─╯ ╰────╮ │ ..55..╰─╯ │ ╭─╮
╭──╯ ╰────╯ ╰───╯ ╰─╯ ╰───╯ ..61..╰─╯ ╰─
Marcel Logen
2024-07-27 10:45:50 UTC
Permalink
[SHA256 of SCOS2 code]
Post by Marcel Logen
Post by Chris M. Thomasson
1930...9f
?
That's OK.
But note: The indentation in the whole code is done by
two SPACEs per step. Exception: in the last "fprintf"
command.
The file size of Richard Heathfield's code is
1753 Bytes, BTW. (After changing the last fprintf
command.)

Original reference implementation:
<http://al.howardknight.net/?ID=166748721500>
(without change in the last fprintf)

Change:
<http://al.howardknight.net/?ID=166786341400>

Marcel (Lines: 32)
--
╭─╮ ╭──╮ ..52..╭────────╮ ╭───
╭───╮ ╭─╯ │ ╭─╯ ╰─╮ ╭─╮ ╭─╮ ╰─╮..61..╰─╯
╭─╯ ╰──╮ ╭─╮ ╭───╮ │ ╰───╯ ╭───╯ ╭─╯ ╰─╯ │ ╭──╮ │ ..67..
╯ ╰───╯ ╰─╯ ╰─────╯ ╰─────╯ ╰─╯ ╰─╯ ..67..
Rich
2024-07-26 03:54:29 UTC
Permalink
Post by Chris M. Thomasson
I dug up my old impl of scos2. Does this work for you?
scos2 247 742
KWNYTZ JYFQV,H.Nw
rXZ
scos2 65 33

0ZGS XB sJ@ lH ~i<8/
Chris M. Thomasson
2024-07-26 05:15:20 UTC
Permalink
Post by Rich
scos2 65 33
For some reason I am getting a plaintext of:

~U9o My 8/g v[ Ym9\;

using my impl and Rich's original scos2 impl.

Here is the ciphertext for using Rich's original SCOS2 with a key of 3 7
________
Hello World
________

Ko29_ 8/CDC


Can you decrypt it? Thanks.
Richard Harnden
2024-07-26 09:32:10 UTC
Permalink
Post by Chris M. Thomasson
Post by Rich
scos2 65 33
~U9o My 8/g v[ Ym9\;
using my impl and Rich's original scos2 impl.
The key is wrong, try:

28 60
0ZGS XB sJ@ lH ~i<8/
Chris M. Thomasson
2024-07-26 22:13:43 UTC
Permalink
Post by Chris M. Thomasson
Post by Rich
scos2 65 33
~U9o My 8/g v[ Ym9\;
using my impl and Rich's original scos2 impl.
28 60
Indeed it works like a charm. It had to be a "key issue". Humm... That
would be a fun test? Try different keys and log "readable" results wrt
decrypted plaintext? ;^)
Ben Bacarisse
2024-07-27 00:20:34 UTC
Permalink
Post by Chris M. Thomasson
Post by Chris M. Thomasson
Post by Rich
scos2 65 33
~U9o My 8/g v[ Ym9\;
using my impl and Rich's original scos2 impl.
28 60
Indeed it works like a charm. It had to be a "key issue". Humm... That
would be a fun test? Try different keys and log "readable" results wrt
decrypted plaintext? ;^)
Yes. Somewhere I have a program that just tries all keys. I was going
to get it to stop when English (or C) letter frequencies were found but
it turned out simpler just to eyeball the output. As a human, you can
spot a decrypt a mile off and, if I remember correctly, SCOS has "close
decrypts" that I could spot but which would look, statistically, like
plaintext.
--
Ben.
Richard Harnden
2024-07-27 07:20:37 UTC
Permalink
Post by Ben Bacarisse
Post by Chris M. Thomasson
Post by Chris M. Thomasson
Post by Rich
scos2 65 33
~U9o My 8/g v[ Ym9\;
using my impl and Rich's original scos2 impl.
28 60
Indeed it works like a charm. It had to be a "key issue". Humm... That
would be a fun test? Try different keys and log "readable" results wrt
decrypted plaintext? ;^)
Yes. Somewhere I have a program that just tries all keys. I was going
to get it to stop when English (or C) letter frequencies were found but
it turned out simpler just to eyeball the output. As a human, you can
spot a decrypt a mile off and, if I remember correctly, SCOS has "close
decrypts" that I could spot but which would look, statistically, like
plaintext.
I have one that tries to find consistent incr's in 3-letter word-blocks.
Hopefully the correct base and incr bubble to the top.

It's better with longer texts, but ...

$ cat test.scos
0ZGS XB sJ@ lH ~i<8/

$ ./decode_scos test.scos | ./scos
./decode_scos: Not sure, but ...
Post by Ben Bacarisse
-28 -60
Yes, it can be read.
-71 -60
=~Bu :C ]}, [~ A~}#s
Chris M. Thomasson
2024-07-31 04:08:34 UTC
Permalink
Post by Richard Harnden
Post by Chris M. Thomasson
Post by Chris M. Thomasson
Post by Rich
scos2 65 33
~U9o My 8/g v[ Ym9\;
using my impl and Rich's original scos2 impl.
28 60
Indeed it works like a charm. It had to be a "key issue". Humm... That
would be a fun test? Try different keys and log "readable" results wrt
decrypted plaintext? ;^)
Yes.  Somewhere I have a program that just tries all keys.  I was going
to get it to stop when English (or C) letter frequencies were found but
it turned out simpler just to eyeball the output.  As a human, you can
spot a decrypt a mile off and, if I remember correctly, SCOS has "close
decrypts" that I could spot but which would look, statistically, like
plaintext.
I have one that tries to find consistent incr's in 3-letter word-blocks.
 Hopefully the correct base and incr bubble to the top.
It's better with longer texts, but ...
$ cat test.scos
$ ./decode_scos test.scos | ./scos
./decode_scos: Not sure, but ...
-28 -60
Yes, it can be read.
-71 -60
=~Bu :C ]}, [~ A~}#s
The key space is not that massive, so it can be brute forced for sure.
However, its interesting wrt the plaintext. What if the plaintext is
generated from a random source?
Chris M. Thomasson
2024-07-31 04:09:59 UTC
Permalink
[...]
Post by Chris M. Thomasson
The key space is not that massive, so it can be brute forced for sure.
However, its interesting wrt the plaintext. What if the plaintext is
generated from a random source?
Afaict, if the plaintext is random, then its going to be hard to
identify it as a legit plaintext?
Richard Harnden
2024-07-31 10:24:21 UTC
Permalink
Post by Chris M. Thomasson
[...]
Post by Chris M. Thomasson
The key space is not that massive, so it can be brute forced for sure.
However, its interesting wrt the plaintext. What if the plaintext is
generated from a random source?
Afaict, if the plaintext is random, then its going to be hard to
identify it as a legit plaintext?
If the plain text is random, then you'd never know if you got the
correct decrypt anyway.

It only works for English (or C) text. It seems to work okay for French
and "lorem ipsum". It doesn't like German.

It's doubtless slower cpu-timewise that brute forcing. It saves on
eyeball-time.
Chris M. Thomasson
2024-07-31 18:33:54 UTC
Permalink
Post by Richard Harnden
Post by Chris M. Thomasson
[...]
Post by Chris M. Thomasson
The key space is not that massive, so it can be brute forced for
sure. However, its interesting wrt the plaintext. What if the
plaintext is generated from a random source?
Afaict, if the plaintext is random, then its going to be hard to
identify it as a legit plaintext?
If the plain text is random, then you'd never know if you got the
correct decrypt anyway.
Bob would know the correct decrypt because he has the same secret key as
Alice? So, for some reason Alice wants to send some random data to Bob,
but encrypts it using SCOS2... Bob knows how to decrypt it via the
secret key... Eve might not be able to get at the data even with brute
force? Is this fair enough or moronic? ;^o
Post by Richard Harnden
It only works for English (or C) text.  It seems to work okay for French
and "lorem ipsum". It doesn't like German.
It's doubtless slower cpu-timewise that brute forcing. It saves on
eyeball-time.
Rich
2024-07-26 13:55:15 UTC
Permalink
Post by Chris M. Thomasson
Post by Rich
scos2 65 33
~U9o My 8/g v[ Ym9\;
I do too, when I try.
Post by Chris M. Thomasson
using my impl and Rich's original scos2 impl.
Here is the ciphertext for using Rich's original SCOS2 with a key of 3 7
________
Hello World
________
Ko29_ 8/CDC
Can you decrypt it? Thanks.
Yes.
Chris M. Thomasson
2024-07-26 22:10:33 UTC
Permalink
Post by Rich
Post by Chris M. Thomasson
Post by Rich
scos2 65 33
~U9o My 8/g v[ Ym9\;
I do too, when I try.
Ahhh good. I thought it might be an issue in my crude impl, then when
Richards original SCOS2 gave the same output, I was like humm... Key
issues? Pondering... ;^)
Works like a charm with 65 33. Thanks Rich.
Post by Rich
Post by Chris M. Thomasson
using my impl and Rich's original scos2 impl.
Here is the ciphertext for using Rich's original SCOS2 with a key of 3 7
________
Hello World
________
Ko29_ 8/CDC
Can you decrypt it? Thanks.
Yes.
Perfect.
Loading...