More common is software encryption. While this is generally considered less secure, it does not require specialized hardware to do the job, and can be done quickly and cheaply—often for free, and on the fly, hence “on the fly encryption". So, software encryption is far more flexible than hardware encryption, making it more suited to portable devices like laptops and flash drives.
Most software encryption programs work by requiring a password to either encrypt or decrypt data on the hard disk, using the given program.
Software may encrypt either individual files, folders, or create encrypted volumes. While software encryption can come close to duplicating whole disk encryption, it still cannot encrypt certain functions, such as the master boot log, a serious vulnerability. Another major weakness of software encryption is that it doesn't typically encrypt temporary files, which may also have sensitive information on them.
There are many features that may be available on encryption software. One of the most useful of these is the ability to create “hidden volumes", which are basically password-protected volumes within the main container volume. This allows for plausible deniability. What one can do is create nests of encrypted volumes, so that while a user may be forced to give up the initial password, without explicit knowledge of the other encrypted volumes a potential hacker can't know that there is more data on the device
Most operating systems have some sort of encryption software built in, which can generally get a basic level of encryption done and protect against basic attacks. For more advanced protection, you might need to go hunting for something that suits your needs, and there is a huge variety to select from, from opensource freeware like GNU Privacy Guard and True Crypt to proprietary software like CheckPoint.