[ogg-dev] Encrypting Ogg

Conrad Parker conrad at metadecks.org
Mon Apr 17 18:14:46 PDT 2006


On Mon, Apr 17, 2006 at 03:07:30PM -0500, Shawn AutoDMC Boles wrote:
> Howdy.
> 
> I have a application I'm developing where I need to encrypt the data 
> inside an OGG stream.  I will be using a regular block cypher (AES, or 
> others... configurable); and I would like to encrypt the pages in an OGG 
> stream.
> 
> I'm thinking that if I sit my decrypter in between the reading 
> application and the encrypted file, you should be able to use all the 
> normal seeking operations, etc, on the "encrypted" file as the cleartext 
> stream.
> 
> But my brain gets a bit stuck on implementation... I'm not quite sure 
> how to "interpose" my library/application that way.
> 
> I'm using Python for development (I can always backtrack to C++/etc); 
> my application should take an encrypted OGG stream and a key, and you 
> should be able to seek through the file as if it wasn't encrypted.
> 
> Any pointers?  Similar projects?  Any help would be appreciated.

You'd probably want to encrypt the data in ogg packets, not pages. That
way you can still use the existing paging mechanism and existing ogg
libraries to find encrypted packets and seek through the data.

There's not much in the way of python modules that will help with what
you want; I think there is a python wrapper for the low-level libogg,
but that's not particularly useful by itself.

If you're comfortable with dropping to C I'll suggest you use liboggz,
which provides an API for seeking. You can find it and some
documentation at http://www.annodex.net/software/liboggz/

btw. I'd also be pretty keen on some python bindings for liboggz ...

Conrad.


More information about the ogg-dev mailing list