The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> System Administration
> Security and Cryptography
|
RSA block decryption
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.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

December 17th, 2011, 02:36 PM
|
|
Registered User
|
|
Join Date: Dec 2011
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"?
Any kind of help is appreciated! 
|

December 25th, 2011, 10:48 AM
|
|
Registered User
|
|
Join Date: Dec 2011
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?
|

December 26th, 2011, 08:22 AM
|
|
Registered User
|
|
Join Date: Dec 2011
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.
|

December 26th, 2011, 04:28 PM
|
|
Registered User
|
|
Join Date: Dec 2011
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 
|

December 30th, 2011, 03:25 PM
|
|
Registered User
|
|
Join Date: Dec 2011
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.
How does that sound?
|

December 30th, 2011, 08:32 PM
|
|
Registered User
|
|
Join Date: Dec 2011
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.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|