AES anyone?

BCS ao at pathlink.com
Fri Aug 17 11:46:49 PDT 2007


Reply to Bedros,

> can you explain your idea of streaming?

It would sit on top of another stream object (a socket or file object or 
whatever). When it is given data it would encrypt it and pass it out the 
other side. Another object at the other end would receive the data and decrypt 
it. If, for instance, the intervening data path is a network socket, then 
the code that uses the stream would be able to treat the objects as if they 
were the socket it's self. As to the 16 byte issue, undersized packets would 
be padded and the length would also transfered with them. How, would be up 
to the implementation.


IIRC Tango has a way of doing this sort of filtering.

> 
> I was thinking of passing a buffer (pointer) to the AES function (with
> mode and keys), along with the length. and the you get back the cipher
> data.
> 
> please remember that AES only processes data in increments of 16bytes.
> So, if you send 17 bytes, you'll get cipher data length of 32byte; and
> you need all the 32 bytes to decrypt. if you pass 127 bytes, you'll
> get back 128bytes.....etc.
> 
> so, it's important to keep track of the length of plain (original)
> data along with the cipher data, so we can trim the extras once we
> decipher it.
> 
> -Bedros
> 





More information about the Digitalmars-d mailing list