1

Can we assume that same encryption key is used to encrypt data if encrypted data are same?

For example, plain text is 'This is sample'.

First time we use 3DES algorithm and encryption key to encrypt it. Encrypted data became 'MNBVCXZ'.

Second time again, we use 3DES algorithm and encryption key to encrypt it. Encrypted data became 'MNBVCXZ'.

My questions are:

  1. Can I assume static encryption key is used in this encryption process?
  2. How many keys can be used to encrypt data using 3DES algorithm?
Maarten Bodewes
  • 90,524
  • 13
  • 150
  • 263
goutthee
  • 329
  • 4
  • 14
  • 1
    Over here, you have two different keys resulting in the same ciphertext: http://stackoverflow.com/questions/1284412/why-does-changing-one-bit-in-a-triple-des-key-or-initial-value-not-give-differen (but the difference was "just" in parity bits, so I am not sure if you want to count that). – Thilo Jun 23 '16 at 08:23
  • 1
    3DES has a key strength of 168 bits. That means that there are 2^168 different keys. – Thilo Jun 23 '16 at 08:29
  • if the same plaintext ends up as the same ciphertext, then, yes, the same key was used (module parity bits, see above). If different plaintexts end up as the same ciphertext, then different keys have been used (otherwise decryption would not work). – Thilo Jun 23 '16 at 08:31
  • how can we tell key length is 112 or 168 bits? – goutthee Jun 23 '16 at 08:31
  • The 112 and 56 bit options are weaker versions of 3DES. You have to know which one you want to use (looking at your keys will tell you). – Thilo Jun 23 '16 at 08:34
  • how many key can be used to encrypt data in 3DES? – goutthee Jun 23 '16 at 08:40
  • there are 2^168 different keys. – Thilo Jun 23 '16 at 08:45
  • for example, there are two plain text 1. 'this is sample1' 2. 'It has sample2' Encrypted data for 1 is 'abcdefgh' Encrypted data for 2 is 'abcdijkl' since first part is same, can i assume there are more than one encryption keys and first part use same encryption key? – goutthee Jun 23 '16 at 08:53
  • Thilo, u mean there can be 2^168 different keys to encrypt data? person who wants to encrypt data (developer) cannot decide how many key he wants to used to encrypt data? sorry i'm so new to this cryptography. – goutthee Jun 23 '16 at 09:00
  • I found out 3DES supports 64, 128, 192, and 256 bits key size. Then What's differences from 56-bits,112-bits, and 168-bits again :( – goutthee Jun 23 '16 at 09:29
  • 1
    @goutthee The parity bits. Those are usually present, but they are not included in the DES operation itself. You may want to study the algorithm before using it. 3DES for instance *does not* support 256 bit key sizes. – Maarten Bodewes Jun 24 '16 at 09:28

1 Answers1

2

Can I assume static encryption key is used in this encryption process?

Yes, if you perform the encryption yourself (with a very high probability), no if an adversary can perform the encryption and the plaintext/ciphertext is relatively small.

As 3DES does indeed have 2^168 possible keys and 2^64 possible blocks, it should be obvious that some keys will encrypt a single plaintext to the same ciphertext. Finding such a pair of keys requires about 2^32 calculations on average (because of the birthday paradox).

If the plaintext is larger (requires more than one block encrypt) then the chance of finding a different key that produces the same ciphertext quickly will go to zero.

If one of the keys is preset it will take about 2^64 calculations to find another key. And - for the same reason - there is only a chance of 1 / 2^64 to use two keys that unfortunately produce the same ciphertext for a specific plaintext.

If you want to make the calculations yourself, more information here on the crypto site.


How many keys can be used to encrypt data using 3DES algorithm?

2^168 if you consider the full set of possible keys, i.e. you allow DES-ABC keys. These keys are encoded as 192 bits including parity. This would include DES-ABA and DES-AAA keys (the latter is equivalent to single DES).

2^112 if you consider only DES-ABA keys. These keys are encoded as 128 bits including parity. This would include single DES.

Community
  • 1
  • 1
Maarten Bodewes
  • 90,524
  • 13
  • 150
  • 263
  • @ArtjomB. I think I caught that one: "If the plaintext is larger (requires more than one block encrypt) then the chance of finding a different key that produces the same ciphertext quickly will go to zero." – Maarten Bodewes Jun 27 '16 at 19:47
  • @ArtjomB. No problem, thanks for keeping me sharp :) – Maarten Bodewes Jun 27 '16 at 19:51