Chaffe - Chaffing and Winnowing.


    $Revision: 1.5 $


    my $ch = new Chaffe;

    $noise = $ch->noise;

    $mac = $ch->secret;

    $chaffed_text = $ch->chaffe($text)
    $ch->chaffe($text, \*FILEHANDLE);

    $text = $ch->winnow($text);
    $text = $ch->winnow(\*FILEHANDLE);


This module is based in interesting ideas which can be found in the following paper:


Please see that document for the theoretical basis for what I am trying to do in this module.

Please be warned that this is a tremendously alpha implementation of this concept. There are a number of upsetting things I do. Random number generation, for example, uses whatever perl (and thus, your C library) provides.



    my $ch = new Chaffe;

This creates a new chaffing object. It initializes a number of things, including a default random function which is seeded (see srand and rand in your perl documentation).


    $rand_function_ref = $ch->random_function;

You may insert your own random function into the chaffing code, which is used to randmonzie MACs and bits (chaffe production) and to determine how much chaffe to produce per bit.

The function must take a single argument, $r, and should return a real value between 0 and $r.

The default function simply uses the rand function which comes with perl.


    $noise = $ch->noise;

This sets the noise value: how many chaffe tuples to add per packet. This value actually sets the upper limit of a random selection between 2 and your noise value. Defaults value is 8.


    $mac = $ch->secret;

This sets (or gets) the ``shared secret'' or ``message authentication code'' for the chaffing or winnowing. This value, a string of any length, should be treated with the same respect you give a passphrase.

In this implementation, the shared secret is simply tacked onto the end of the bit via string concatenation.


    $chaffed_text = $ch->chaffe($text)
    $ch->chaffe($text, \*FILEHANDLE);
    $ch->chaffe($text, \*FILEHANDLE, $filter_ref);

This does all the exciting work. It will either return a string of chaffed text or spew the text into the opened file specified in the second form.

The third for is for making it easy to compress chaffed text. Alpha version of this feature, so you might want to avoid using it just now.

Don't expect this to be fast. And the size of the output should astound you nicely, too.

The format of the tuples is simple, but adds additional fluff to the chaffed text size, since I'm hoping to keep this as portable as possible (yes, this is a string).

    "serial-bumber bit md5-checksum\n"

The md5 checksum is output in hex. You can save chaffed information in a file, or email it without further groveling over your results, although any but the shortest messages may be a bit ridiculous to send by email.


    $text = $ch->winnow($text);
    $text = $ch->winnow_from_fh(\*FILEHANDLE);

Winnow the text (or text in the specified file), returning the wheat. Currently, you cannot winnow into a file.


William S. Annis, Biomedical Computing Group,

Copyright (c) 1998 William S. Annis. All rights reserved. This is free software; you can redistribute it and/or modify it under the same terms as Perl itself (the Artistic Licence).


Slow. I would not want to chaffe a huge document with this.

Explodes the text chaffed. I would not want to chaffe a huge document with this.