Discuss RSA block decryption in the Security and Cryptography forum on Dev Shed. RSA block decryption Security and Cryptography forum discussing issues related to coding, server applications, network protection, data protection, firewalls, ciphers and the like.
Receive the tools necessary to be the rock star of your field. Our 12-month program teaches you the evolving world of multi-channel marketing as well as the complex issues and opportunities found in the industry.
ASP Free and Iron Speed Designer are giving away $5,500+ in FREE licenses. Iron Speed's RAD CASE toolset can save up to 80% of your coding time. One free license per week, one perpetual license per month! Download and Activate to enter!
Web development can be a daunting task, even for specialists. There is a lot of information to absorb and a lot of technologies to learn in order to manage a superior website. When trying to learn the ropes, developers need a reliable source to introduce new ideas that can be easily implemented. When working on large projects, even web veterans may run into a technology or an aspect of a technology that they are unfamiliar with.
Posts: 3
Time spent in forums: 1 h 10 m 37 sec
Reputation Power: 0
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"?
Posts: 11
Time spent in forums: 1 h 32 m 54 sec
Reputation Power: 0
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?
Posts: 3
Time spent in forums: 1 h 10 m 37 sec
Reputation Power: 0
Quote:
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.
Posts: 11
Time spent in forums: 1 h 32 m 54 sec
Reputation Power: 0
Quote:
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
Posts: 3
Time spent in forums: 1 h 10 m 37 sec
Reputation Power: 0
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.
Posts: 11
Time spent in forums: 1 h 32 m 54 sec
Reputation Power: 0
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.