4

I have been looking at block ciphers, and I found this: CBC

Do the little circles with the plus symbols mean XOR? And how are the plaintext blocks split, and ciphertext blocks combined? Also, how can you XOR text? Can't you only XOR binary? Thank you!

Bennett
  • 163
  • 5
  • 1
    Yes, it is XOR. About text/binary: Why do you think text isn´t stored as binary data? – deviantfan Aug 01 '15 at 08:01
  • 1
    This topic seems more appropriate and would get more answer on [crypto.se]. – WhiteWinterWolf Aug 01 '15 at 09:52
  • @WhiteWinterWolf Whoops. Sorry! – Bennett Aug 02 '15 at 01:15
  • @Bennett: No problem, StackExchange is a network of [several websites](https://stackexchange.com/sites#technology) dedicated to specific topics. Some topics however are a bit overlapping so it may not be obvious at first where to post some questions, the main concern being to choose the site which will allow to reach the people with the most appropriate knowledge :). – WhiteWinterWolf Aug 02 '15 at 09:26

3 Answers3

3

The little circles are indeed XOR.

The size of the blocks depend on the cipher you use, for instance AES-128 has a 128 bit block size (NOTE: the 128 in AES-128 stands for the key size, not for the block size). Note that CBC is Cipher Block Chaining, an operation mode how you use a cipher, not the cipher itself.

The XOR operation is logically on the bits of the plaintext. Everything, also what you are referring to as "text", is internally in any digital computer represented by bits (or bytes=8 bits).

Once the encryption or decryption is done, all bits are put after another. So it would be text from ciphertext 1 then following ciphertext 2 and so on. Depending on byte order the representation might also be the other way around.

John
  • 997
  • 5
  • 14
0

The x circles are XOR.

  1. Yes, you can only xor binary data, but the idea is that you change the plain text to binary.
  2. The plain text block split is based on the encryption algorithm you are using.

If you are using a DES block size that contains (plain text) is 64 bit, so this divides data into blocks based on encryption algorithm you are using.

peterh
  • 2,938
  • 6
  • 25
  • 31
0

Extending the previous answers:

  • Typically data is compressed before encryption, thus the ciphertext means in practice a compressed, binary data, on various reasons:
    • It decreases (eliminates) the problems coming from that a periodic plaintext can cause also a periodic ciphertext
    • Hugely decreases the possibilities of different attacks (for example, changing a bit in the plaintext and see how the ciphertext changes, and so on)
    • Cryptology is about problematic communication channels, they have often also different problems, thus decreasing the size of the plaintext is often useful.
  • Plaintext and ciphertext is traditional terminology because cryptology originates from the ancient era, far before the computers, where the primary concern was to encrypt text messages. In fact, both of them are binary data today.
  • The split and combination means what they are: in encryption, the key and the plaintext is "combined" to be the ciphertext. In decryption, the cipher and the key are used to decode the data.
  • However, the very last row can be easily misunderstood, because nothing says that is refers a chaining modus and not to the decryption of an induvidual block.
    • This diagram is correct if we use always the previous block as key to encode the next one. It may be useful, but not always appliable. For example, if we encrypt a hard drive, then it is an impossible goal to use a chained mode on obvious reasons.
peterh
  • 2,938
  • 6
  • 25
  • 31
  • Yes CBC always uses the previous ciphertext block if it exists else the IV. This doesn't prevent random decryption, because you only need the previous ciphertext block, you don't need to decrypt any previous block much less all of them. Of course there are other modes, and the diagrams for other modes are different. – dave_thompson_085 Jun 01 '18 at 02:33
  • @dave_thompson_085 Well, it is right. However, then - in the case of a crypted hard drive - all the blocks after a modified block should be re-ecnrypted in the case of a block modification, isn't? – peterh Jun 01 '18 at 03:02
  • @peterh Disk encryption encrypts each sector (or set of sectors) separately (generally with XTS now, although CBC-ESSIV was once popular). You seem to be confusing ciphers and [modes](https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation). – AndrolGenhald Jun 01 '18 at 13:36
  • @AndrolGenhald I tried to make it more clear. How about now? – peterh Jun 01 '18 at 14:15
  • @peterh I still don't understand why you're saying "the very last row in your picture is imho incorrect". That's how CBC works. When you say "multiple parts (bits) of the key are applied to the blocks multiple times" it sounds to me like you're talking about a cipher, but maybe it's just not clear enough. – AndrolGenhald Jun 01 '18 at 14:27
  • @AndrolGenhald Done (hopefully). – peterh Jun 01 '18 at 14:30