#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Posts
    3
    Rep 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!
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Posts
    11
    Rep 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?
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Posts
    3
    Rep Power
    0
    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.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Posts
    11
    Rep Power
    0
    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
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Posts
    3
    Rep 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?
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Posts
    11
    Rep 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.

IMN logo majestic logo threadwatch logo seochat tools logo