News for hackers. Stuff that matters.
Re:RSA and Python by dfboyd on Saturday March 28, 2026 @02:26PM (#47557098)
The way the article uses RSA is no better than a simple substitution cipher. Both the "l"s in "hello" are enciphered to 2575. It's a newspaper cryptogram.

You're supposed to concatenate all the input numbers, to create a message that has hundreds or thousands of digits; then RSA-encrypt that number.

Re:RSA and Python by hannob on Saturday March 28, 2026 @03:42PM (#47557606)
> You're supposed to concatenate all the input numbers, to create a message that has hundreds or thousands of digits; then RSA-encrypt that number.

That's not how it works...

In modern protocols, you don't encrypt at all with RSA. You use a key exchange, and if you use RSA, you only use it as a signature algorithm to initiate the key exchange.

If you happen to want to encrypt with RSA, which you usually shouldn't, you first use a padding algorithm (the modern variant of that is called RSA-OAEP) with which you prepare and then encrypt a random key. That key you then use for symmetric encryption.

Re:RSA and Python by NewsaHackO on Saturday March 28, 2026 @03:23PM (#47557462)
I thought it was a padding scheme, where you use a moving mask to obscure the plaintext, then encrypt that. Since it's being XOR'ed, adjacent characters will not have the same encryption values anymore. Sort of like using CBC instead of ECB for block ciphers. However, because this article is about the maths with RSA itself, he probably correctly thought it was not relevant to what he was writing about and would just unnecessarily complicate things.
Re:RSA and Python by pfortuny on Saturday March 28, 2026 @03:04PM (#47557339)
And pad! Padding for RSA is like CDM (?) for AES.