Score:-1

Am I Doing RSA Correctly?

in flag

I am trying to figure out how to complete RSA manually. I am trying to encode a simple block message (Mi). I used CrypTool to determine the encryption. When I "manually" computed the plaintext, I obtained a different number than what CrypTool provided. Can someone guide me? Am I doing the manual encryption for RSA correct?

RSA Manually

Ievgeni avatar
cn flag
What is the integer $A$?
Ievgeni avatar
cn flag
It could be also $Z$...
SSA avatar
ng flag
SSA
there are many textbook RSA example on internet, please refer to them. your Z is called ${\phi(n)}$ . and public exponent e is chosen as ${1<e<\phi(n)}$, and private exponent d is selected such that ${ed \equiv 1(mod(\phi(n))}$
kelalaka avatar
in flag
Just used the [Cryptool Online RSA](https://www.cryptool.org/en/cto/rsa-step-by-step) with your setup and got the $\color{red}{Red}$ numbers. What is your problem, then?
in flag
@kelalaka Thank you for the online resource! When I used CrypTool RSA Encryption and input the text MI, I receive the following: Numbers input in base 10 format: 360 / Encryption into ciphertext: 11,807. Why is there only one number?
kelalaka avatar
in flag
That is input handling. The online tool uses to encrypt character by character. The other combines them into a large integer. Note that there is a limit on this due to the modulus and remember that RSA is not preferred for encryption.
Yves avatar
cn flag
I checked it with version 1.4.42: When using the default settings of CrypTool 1 it works well and shows the results you expected. This fits with the answer of Peregrinus.
fgrieu avatar
ng flag
This is an exercise done correctly, or not, depending on how it was asked to encode the plaintext. But this is not RSA done correctly. For one, the factors of $n$ are much too small, making it possible to factor $n$. For another, the encoding of message `MI` to representative integer(s) $m$ does not map to an essentially random and unpredictable element of $\mathbb Z_n$, as it should.
Score:1
gb flag

As kelalaka mentioned in the comments, the reason for the difference is that the tool turns the message "MI" into a single number 360, while you have encrypted each character "M", "I" individually in your question.

The way that the tool turns the message "MI" into the number 360 is because it uses the alphabet of 26 capital letters plus the space character (number 0), giving 27 in total. So it turns each character into a digit between 0 and 26, and then convert from base 27 to base 10. In your case this gives: $$ \text{"M"} = 13 \\ \text{"I"} = 9\\ 13*27 + 9 = 360$$

It then encrypts this number 360 in the same way, using $$360^{11} \pmod{40741} = 11807.$$ You can decode the base 10 number (360) back into a message by turning it back into base 27, giving digits $(13, 9)$, and then computing their corresponding position in the alphabet ("M", "I").

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.