Boost logo

Boost :

Subject: [boost] [cryptography] concept
From: Kasra Nassiri\(Math & ComSci\) (kasra_n500_at_[hidden])
Date: 2008-10-19 15:00:19


Hi all,

I mentioned not a while ago that I am planning to write a boost cryptographic library. I am getting there.

We have template classes that implement a certain interface (not virtual functions). These classes are:

secure_allocator:
    An allocator which removes the buffers allocated when they
    are destructed by overwriting them.
  
block_cipher:
    Any class that could set a key and encrypt/decrypt
    a constant size of message. (I have included AES,
    Serpent, Twofish and MARS, however, we could always
    add more algorithms)

stream_cipher:
    By definition stream_cipher is a cipher that
    could process messages of any length.

hash_function:
    Is a class that could compute a cryptographically
    secure hash signature for an arbitrarily long messages.
    (I have added whirlpool and will be adding more).

wipe_algorithm:
    An algorithm that provides the patterns of wipe
    for a given pass and fills a given buffer with patterns
    (It needs to have a prng template to be used on random
    patterns).

By using a mode of operation we could turn the concept of block_cipher into a stream_cipher. For example cryptolib::ctr<cryptolib::aes> is a stream_cipher concept. I have implemented ictr, ctr and will be implementing XTS, LRW soon.

classes:

cryptolib::entropy_poll<cryptolib::hash_function>:
    A class that polls random data and mixes the
    data using a hash function.
 
cryptolib::entropy_thread<cryptolib::entropy_poll>:
    Calling the polling function of the entropy_poll
    at "random" but regulated intervals using
    boost::thread library.

cryptolib::crypto_istream<cryptolib::stream_cipher>:
cryptolib::crypto_ostream<cryptolib::stream_cipher>:
cryptolib::crypto_oistream<cryptolib::stream_cipher>:
    classes that behave similar to 'std' iostream
    ,however, they seamlessly encrypt/decrypt the
     data as they operate.

cryptolib::wipe_fstream<cryptolib::wipe_algorithm>:
    Wipes the file using the patterns by the template
    wipe algorithm. This class would determine the
    cluster size and wipe the entire cluster occupied
    by the file (this is platform specific, so we need
    to implement the algorithm for different platforms).

finally we have the cryptolib::crypto_fstream that could be given a direction (i.e. encryption or decryption) and will operate seamlessly on the data.

What do you think? Anything that I am missing on?

Best regards

Kasra

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk