Thursday, August 11, 2005

Filter: OpenSSL's best feature

I am immensely impressed by filters of OpenSSL. I just can't wait to use my first filter. Filters form a chain which is the best thing a programmer can want while doing cryptographic programming. The easiness to use a filter or a chain amazed me most. At the end of a chain resides a source or a sink. A source, as its name suggests, supplies data to be read. You can write data to a sink. To build a chain, you attach one or more filters with a source or a sink. Filters can do many things e.g. encryption, decryption, encoding, decoding etc. You just set up a chain according to your need, invoke the head of the chain, data will be read or written accordingly. For example, if you want to write some data in encrypted and encoded form, build a chain of this order EncryptionFilter->EncodingFilter->Sink and then write to the EncryptionFilter. Things are as simple as that.

No comments: