Skip to main content
gamedev.net
🔒 Locked

block ciphers

Started by Lode 2 replies 650+ views
Original Post
Lode
Lode
In a block cipher like xtea, each block is 64 bit which is only a measily 8 ascii characters per block. If a text document is encoded with it and you know that it's a HTML document, you almost certainly know what the first 8 characters of the document will be (for example something like "<?xml ve" or "<html><h"). Is it then not easy to discover what the key of the encryption is when you know one block? If that is so, in what way are block ciphers secure then? Are stream ciphers more secure?
Vorpy
Vorpy
This is called a "known plaintext attack" and encryption algorithms that are known to be vulnerable to it are generally considered to be much less secure than those that aren't, for obvious reasons.
strtok
strtok
If the attacker knows the plaintext for a complete block (or even a partial block), this _may_ aid them in obtaining the key, depending on the strength of the algorithm. Any key can be brute forced, but the time it takes to do so makes this infeasible in most cases. If there is known cryptanalysis for the algorithm and a weakness that can be exploited, it might be possible to obtain the key with some known plaintext.

You can make a block cipher more secure by turning it into a chained block cipher. This involves using the prior encrypted output block as a secondary input to the next block (along with the secret key). This makes it much harder to crack because each block can no longer be analyzed independently of the others.

The advantage of block ciphers, or chained block ciphers, is that they are easy and fast, and work well enough in most cases with a decent key size (although it depends on the algorithm, plain old DES isn't really safe anymore, whereas something like AES is more than suitable in most cases).

My memory seems a bit foggy on stream ciphers, so I'll refrain from commenting on them.
krum
krum
Quote:
Original post by Lode
In a block cipher like xtea, each block is 64 bit which is only a measily 8 ascii characters per block.

If a text document is encoded with it and you know that it's a HTML document, you almost certainly know what the first 8 characters of the document will be (for example something like "<?xml ve" or "<html><h").

Is it then not easy to discover what the key of the encryption is when you know one block?

If that is so, in what way are block ciphers secure then? Are stream ciphers more secure?


Stream ciphers are not generally more secure (obviously this depends on what ciphers, keys, etc.). You might want to consider padding the beginning of your document with garbage. This will throw off a known plaintext attack.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.