On Sun, Jul 09, 2006 at 09:37:35PM +0200, Peter Philipp wrote:
> On Sun, Jul 09, 2006 at 06:06:35PM +0200, Joachim Schipper wrote:
> > > I'm looking for a stream cipher in the kernel that is fairly secure.  
> > > Does it
> > > exist?  Alternatively I'm looking for a block cipher that does CFB 
> > > (Cipher Feedback Mode).  There is a prototype stub for DES CFB in 
> > > /sys/crypto/des.h but I don't see a des.c file in the 3.9 sources, is it 
> > > taken
> > > out of a userland library?
> > 
> > The kernel includes quite a bit of crypto, though I'm not sure how to
> > get at all of it - but svnd(4) uses Blowfish, and ipsec(4) uses almost
> > all of the well-known block algorithms.
> > 
> > What are you trying to do?
> > 
> >             Joachim
> 
> I'm trying to encrypt a stream, per byte (8 bit) instead of per block (usually
> 8 bytes) in the kernel.  CFB and OFB ciphers are ok if they are a block cipher
> as they pretty well can encrypt per byte according to applied cryptography 
> from 
> schneier.  
> 
> Anyhow I'll take a look at the svnd code, perhaps the author of the device
> uses CFB or OFB cipher modes as blowfish is a 8 byte block cipher.
> 
> Oh yeah, I considered a one time pad as an alternative for the purpose, but I 
> cannot do it, as the receiving is not guaranteed to be in sequence which
> one time pads need to be to effectively change a byte back to cleartext.  I
> also cannot get around that with error correction / checksumming.

Use a PRNG in userland (or kernel space, if you're set on doing things
in kernel), and only pass the initial state. Should work fairly well as
long as both sides stay in sync.

Of course, just why this is more efficient than passing it over an SSL
socket is beyond me, but I'll just assume you know what you're doing.

                Joachim

Reply via email to