# Multiple encryption of part of block

Is there any security risk in encrypting parts of blocks twice? I'd like to get around block sizes and make encrypted messages just as long as the unencrypted ones:

Block 1: Byte 0 - 7
Block 2: Byte 8 - 15
Block 3: Byte 16 - 23
Block 4: Byte 21 - 29

In this example blocks 3 and 4 overlap by 2 bytes. I plan on using CAST-128.

Thank you very much for helping!

Florian

• ... with what mode? $\;$ – user991 Feb 2 '15 at 12:37
• We want to use ECB – Florian Feb 2 '15 at 14:19
• Do you understand the risks of using ECB? Also, do you understand the risks of using a block cipher that has a 64-bit block? – mikeazo Feb 2 '15 at 15:14
• We could use CBC. We went for 64-bit blocks because of the small message in an effort to not produce overhead. would it be better to use overlapping 128-bit blocks? – Florian Feb 2 '15 at 15:21
• 1) This technique is known as Ciphertext stealing. It's secure in principle, but as @mikeazo already pointed out using ECB and using 64 bit block ciphers is generally a bad idea. 2) There are fancier length preserving encryption schemes. 3) I strongly recommend adding a nonce/IV and a MAC. While these increase the size of the message, the security implications of not having them can be severe. – CodesInChaos Feb 2 '15 at 15:22