December 17th, 2011, 03:36 PM

RSA block decryption
Hi there!
I have this message that has been encrypted with RSA, the msg (c) is 2145 characters long and the language is unknown
(but my guesses are that it is either english or maybe english encrypted using an 255 character ASCII.)
After a lot of "guessing" I'm pretty sure I've found out p, q, of course n, d and fi(n).
To my problem.
When I want to decrypt m do I first split c into blocks?
or do I first do the decryption (m=c^d mod n) and then split m into blocks?
I know the block size should have something to do with the length of n which in my case is 22.
How should I think and are there any basic rules that I should follow when "block dividing"?
Any kind of help is appreciated!
December 25th, 2011, 11:48 AM

Decryption is the mathematical inverse of encryption, so you do everything opposite, including the order. Was the plaintext encrypted then split into blocks or split into blocks then encrypted?
December 26th, 2011, 09:22 AM

Originally Posted by christopherx
Decryption is the mathematical inverse of encryption, so you do everything opposite, including the order. Was the plaintext encrypted then split into blocks or split into blocks then encrypted?
That I don't know but I can assume the latter.
Because the encrypted text consists of 2145 characters divided into blocks of 22, if I remember correctly.
December 26th, 2011, 05:28 PM

Originally Posted by ogward
That I don't know but I can assume the latter.
Because the encrypted text consists of 2145 characters divided into blocks of 22, if I remember correctly.
Righto. Decrypt, then split into blocks. If that doesn't work, you can always try the other way. More often than not, you'll get a plaintext from a last ditch attempt that you never thought would work in the first place
December 30th, 2011, 04:25 PM

Thanks.
But for some reason I want to take each block and decrypt it and when all blocks are decrypted put them together.
why? I think(not sure tho) that the text is then encrypted again with some substitution cipher.
if it is I could do frequency analysis.
How does that sound?
December 30th, 2011, 09:32 PM

It depends on the complexity of the substitution cipher. Are we talking about a simple substitution cipher (A = C, B = L) or a polyalphabetic cipher? ( Viginere Cipher, running key, etc)
In terms of the block cipher, the point of a block cipher is that the cipher works on a set block of plaintext. So yes, each block is decrypted then concatenated.
Frequency analysis is the best way to attack a linear substitution cipher, but if there's any higher level of diffusion then you will have to employ a few cleverer tactics, but we'll deal with that if we have too
Overall, your approach sounds good to me, just be careful your not making too many assumptions.