Security and Cryptography
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsSystem AdministrationSecurity and Cryptography

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 17th, 2011, 02:36 PM
ogward ogward is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2011
Posts: 3 ogward User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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!

Reply With Quote
  #2  
Old December 25th, 2011, 10:48 AM
christopherx christopherx is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2011
Posts: 11 christopherx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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?

Reply With Quote
  #3  
Old December 26th, 2011, 08:22 AM
ogward ogward is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2011
Posts: 3 ogward User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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.

Reply With Quote
  #4  
Old December 26th, 2011, 04:28 PM
christopherx christopherx is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2011
Posts: 11 christopherx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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

Reply With Quote
  #5  
Old December 30th, 2011, 03:25 PM
ogward ogward is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2011
Posts: 3 ogward User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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?

Reply With Quote
  #6  
Old December 30th, 2011, 08:32 PM
christopherx christopherx is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2011
Posts: 11 christopherx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationSecurity and Cryptography > RSA block decryption

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap