Tag: Source Code

Copying One File to another in C

This is a simple C program that copies the contents of one file onto another file. It is similar to Unix’s cp  command. This C program is called with two parameters i.e. the names of two files. The contents of the file referenced in second parameter are copied onto the file which is referenced by first parameter. 

Read More

Defensive Programming Techniques

This source code is from Thinking in C++, 2nd Edition, Volume 2, by Bruce Eckel & Chuck Allison. You can use Borland, G++ (For version 3 and above only), Microsoft (For C++ with .NET only) to compile and build this source code. Writing perfect software may be a daunting task for developers, but a few defensive techniques which are routinely applied can go a long way toward narrowing the gap between code and ideal. Defensive programming practices are often used where high availability of the application is required, safety if utmost concern, or security is needed for application to work.

Read More

256-bit Serpent VB Implementation

This is a slow but working Visual Basic implementation of the 256-bit Serpent algorithm. Serpent was a finalist for Advanced Encryption Standard (AES) and appears to be a very secure powerful algorithm. The Advanced Encryption Standard, or AES, is a symmetric block cipher chosen by the U.S. government for the encryption of classified electronic data and is implemented in software and hardware throughout the world to encrypt sensitive data.

Read More