

Who can explain what the python lines at the end do? - acqq
http://lists.tartarus.org/pipermail/putty-announce/2011/000017.html

======
PythonDeveloper
prints the following: "Simon Tatham"

Specifically, it takes a power mapped string sequence and shifts the values
off. Each set equates to a line of #'s and spaces. Pretty ingenious, actually.

~~~
acqq
How exactly is he using the pow function? It's a number to the 37th and then
mod 0x13AC59F3ECAC3127065A9, how did he select the numbers and why is he doing
that operations?

~~~
dalke
What it's doing is computing row = x * * 37 mod 0x13AC59F3ECAC3127065A9 with
seven different values of x. The "row" bit i encodes either a 0 (for space) or
1 (for hash), for i in range(0, 79). I think that part of the output you
understand.

The question is how to get the values of "x" and how to get the modulo value.
You just need to compute row * * (1/37) mod 0x13AC59F3ECAC3127065A9 . I can't
for the life of me recall how to do it, but you can see the result at Wolfram
Alpha:
[http://www.wolframalpha.com/input/?i=x+**+37+mod+14864685590...](http://www.wolframalpha.com/input/?i=x+**+37+mod+1486468559035429142160809+%3D+604462963859271849083326)
.

How then do you get the 0x13AC59F3ECAC3127065A9? It needs to be relatively
prime to the values, and larger than any of the output values. Beyond that, I
don't know why that specific (composite, with two factors) number was chosen.
Nor do I know why 37 was chosen.

~~~
acqq
I think you're on the good track. Since there are no new suggestions, my
opinion is:

<http://en.wikipedia.org/wiki/RSA_(algorithm)>

The answer to "why" is: he's the author of the Putty SSH client, and he
decided to use the bignum feature of Python to demonstrate the encryption in
as little code as possible and make the signature out of it.

