Re: Implementing byte stream cipher
- From: David Eather <eather@xxxxxxxxxx>
- Date: Thu, 27 Apr 2006 20:25:46 +1000
Joseph Ashwood wrote:
<hugonz@xxxxxxxxx> wrote in message news:1146088530.492367.72740@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi all,
I am proficient programming microcontrollers, and I want to implement
some form of stream cipher for encrypting serial communications.
What I would like to do is have two serial ports connected to one chip,
and then have plaintext on one port and ciphertext on the other. It
need not be 1bit encryption, an octet at a time will do. Another chip
would be doing decryption.
I can have a symmetrical key hidden in the chip and it would be
impossible to extract it.
Wanna bet? The history of extracting "impossible to extract" keys is substantial and proves time and time again that sooner or later if they really want your key they will get it.
I have considered using TEA, but how can I go
from block to stream?
I recommend against TEA, it's been broken, it's not the worst choice, but it's not the best. The general recommendation is to use AES, ther may be better solutions based on your particular environment but you haven't given enough detail..
As to converting from block to stream, use counter mode (http://csrc.nist.gov/CryptoToolkit/modes/workshop1/papers/lipmaa-ctr.pdf).
Since you're talking about a piece of hardware with a fixed key there are a number of things you need to be aware of:
1) Any cipher mode becomes weaker after 2^(blockSize/2) blocks, for a 64-bit cipher this is 32GB
No. Wrong.
, for a 128-bit cipher this is 256,000 PetaBytes
(295,147,905,179,352,825,856 bytes). Either way you need some mechanism to roll-over the key..
2) You need some way to synchronize IVs. This may sound simple but it can be difficult if your connection is only 1-way
3) You really should provide a Message Authentication Code as well, very often this is at least as critical as message authorization
4) If you use one of the secure microcontrollers already available your dev time will be shorter (Atmel in particular has several)
I understand this may be extremely basic, so
pointing to resources is appreciated, too.
Actually what you're attempting will be extremely difficult to get usable and secure. The packetized design (which you'll need for IV sync) is extremely simple, but making sure the implementation is accurate, includes no bugs (of omission or comission) is virtually impossible.
Joe
- References:
- Implementing byte stream cipher
- From: hugonz
- Re: Implementing byte stream cipher
- From: Joseph Ashwood
- Implementing byte stream cipher
- Prev by Date: Re: Compression leads to encryption NEW COMPRESSION METHOD!
- Next by Date: Re: Compression leads to encryption NEW COMPRESSION METHOD!
- Previous by thread: Re: Implementing byte stream cipher
- Next by thread: Re: Implementing byte stream cipher
- Index(es):
Relevant Pages
|
|