Monthly Archives: April 2004

Implementing RC4 in the BTree Buffer

The students in Computer Science 3 are creating a B-Tree structure in the C++ programming language.  This structure is commonly used for database systems because of its speed for data lookup, retrieval, and storage.  The B-Tree structure uses a buffer class to store the lookup nodes, called BTreeNodes.  These buffers are character arrays that save data in a plain text format when written to disk.  Software security should be a primary design consideration for any application in our connected world.  As such, I am recommending the RC4 algorithm as an encryption method for these buffers.

RC4 is in use today in web servers to secure content delivery over the Internet.  RC4 is also used in wireless networking equipment to encrypt data transmissions over the airwaves.  Its common usage is due to two factors, ease of implementation, and speed.  RC4 is easy to implement because it only requires a few lines of code.  It generates a cipher-stream using a private key.  The cipher-stream is used to encrypt plain text messages and decrypt encrypted messages.  The same algorithm performs both operations.

Implementing the RC4 Algorithm discusses the basics of encryption, explains the RC4 algorithm, and provides an implementation in C++.  Lastly, a proposal for encrypting BTreeNode buffers is included.  Students with a basic understanding of programming should be able to grasp the concepts presented here.  With a little effort, the B-Tree structure can be encrypted.