Click here to Skip to main content
6,630,901 members and growing! (17,790 online)
Email Password   helpLost your password?
Desktop Development » Files and Folders » Encryption     Intermediate License: The GNU General Public License (GPL)

File Encryption Utility

By Nir Dremer

File Encryption Utility based on Blowfish Encryption Algorithm.
VC7, VC7.1, VC8.0Win2K, WinXP, MFC, ATL, Dev
Posted:19 Sep 2002
Updated:22 Sep 2002
Views:147,028
Bookmarked:48 times
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
22 votes for this article.
Popularity: 5.62 Rating: 4.19 out of 5
2 votes, 12.5%
1
1 vote, 6.3%
2

3
2 votes, 12.5%
4
11 votes, 68.8%
5

Sample Image - FileEncryption.jpg

Introduction

After a long search for a simple and secure file encryption utility, that is simple and intuitive to use I've decided to write something of my own.

File Encryption utility is a simple tool for encrypting both text and binary files using the blowfish encryption algorithm.

The utility can create a self extracting encrypted file. For a deep view of how to create a self extracted executable check my other article: Creating Self-Extracted Executable .

Features

File Encryption Utility Has the following features:

  • Fast & Quick File Encryption/Decryption.
  • Internal File Wiping Utility.
  • Creating Self-Extracting Encrypted File.
  • Explorer Integration (through Configuration Dialog).
  • Command Line Parameters.

Language

The File Encryption utility is writen in native C++ using ATL only for windowing classing.

The usage of ATL is minimal so anyone who is not familiar with the library should be able to understand the code as well.

Overview

File Encryption Utility is divided to few small projects:

  • FileEnc � The UI of the file encryption utility, also containing the Processing class which is also used by SelfExtract and it is responsible for reading/writing files.
  • Enc_Blowfish � Blowfish encryption implementation (based upon Bruce Schneier and Jim Conger implementation).
  • SelfExtract � Self Extracting executable "header".
  • GenLib � Small Library holding all commonly used items in other project parts.
  • Builder � Small Console utility for creating the final File Encryption Executable.

GenLib � The General Library

In order to save time and to have a central point for all general purpose classes I'm working with a static library called GenLib.

A stripped version of the GenLib is available with the File Encryption Utility. In this version you can see the following general purpose classes:

  • GenFiles � Openning OpenFile/SaveFile and OpenDirectory Dialog Boxes.
  • SelfExtract � Creating Self-Extracting Executable.
  • Thread � Implementation of a parent class for classes who want to execute code in separate thread (more information can be seen in the header � thread.h).
  • FileWipe � Wiping a File from Hard Drive.

All those classes are under the GenLib namespace.

Additional Encryptions

Inside the FileEnc project there's an interface called EncryptionInterface � implementing this interface can allow you to easily change the encryption the utility uses.

Implementing this interface requires only stream cipher implementation and saves all the overhead of working with files.

Blowfish implementation is statically linked to the utility in order to avoid hacking by changing the dll. With a few minutes of work the utility can support a number of encryption dlls that can be loaded at runtime based on the users decision.

Security

In order to make the utility the most secure I can I've tried wiping information from memory when the application closes.

When looking at the source, you can see that I've used ZeroMemory API and few others APIs to delete information from memory (like the password used).

When encrypting a file you can mark the 'Wipe Source After Process' checkbox and by that insure that the file you're encrypting is not accessible.

Remarks

Decryption does NOT verify password correctness (information is being encrypted without adding any information about the file). As a result when decrypting with the wrong password you will receive a file with junk inside - this is not a bug.

The file encryption is based upon the password length - larger passwords equal better security.

Although I believe that the file wiping method is very secure, to be 100% sure you should use a product dedicated to that purpose.

Reference

Blowfish encryption algorithm - http://www.schneier.com/paper-blowfish-fse.html

Revision History

23 Sep 2002 - Initial Revision

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPL)

About the Author

Nir Dremer


Member
Nir is a Product Manager from Israel with past Software Engineering Experience.

You're welcome to visit his photography site:
http://dremer.org/
Occupation: Marketing
Location: Israel Israel

Other popular Files and Folders articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 25 of 77 (Total in Forum: 77) (Refresh)FirstPrevNext
GeneralMy vote of 1 Pinmembermathgeek549:37 3 Apr '09  
QuestionAES Encryption PinmemberMember 228457120:31 21 Sep '08  
AnswerRe: AES Encryption PinmemberNir Dremer22:19 21 Sep '08  
GeneralRe: AES Encryption PinmemberMember 22845710:00 24 Sep '08  
GeneralRe: AES Encryption PinmemberNir Dremer22:22 24 Sep '08  
GeneralRe: AES Encryption PinmemberPresu2:13 26 Sep '08  
GeneralRe: AES Encryption PinmemberNir Dremer9:40 26 Sep '08  
GeneralProgress bar incorrect Pinmemberdamir_tk11:14 26 Nov '06  
GeneralRe: Progress bar incorrect PinmemberNir Dremer12:11 26 Nov '06  
GeneralRe: Progress bar incorrect Pinmemberdamir_tk12:28 26 Nov '06  
Generalwiping is not that secure PinmemberBilliebub10:58 14 Nov '06  
GeneralRe: wiping is not that secure PinmemberNir Dremer7:16 22 Nov '06  
GeneralNeed an idea Pinmembersudha_sen20:05 19 Oct '06  
GeneralRe: Nice one :) PinmemberNir Dremer5:43 24 Mar '06  
Questionfile folder security Pinmembersalehbk23:15 15 Oct '05  
Generalwant DLL Pinmemberbhavik.dpr4:24 13 Oct '05  
GeneralRe: want DLL PinmemberNir Dremer4:34 13 Oct '05  
GeneralRe: want DLL Pinmemberbhavik.dpr19:32 13 Oct '05  
GeneralRe: want DLL PinmemberNir Dremer20:14 13 Oct '05  
GeneralRe: want DLL Pinmemberbhavik.dpr20:22 13 Oct '05  
GeneralRe: want DLL PinmemberNir Dremer22:16 13 Oct '05  
GeneralRe: want DLL PinmemberNir Dremer22:16 13 Oct '05  
GeneralRe: want DLL Pinmemberbhavik.dpr23:47 13 Oct '05  
GeneralRe: want DLL PinmemberNir Dremer6:43 14 Oct '05  
Generalcompile Pinmemberthanhthuyvn_vtajkhskjakjd15:35 15 Jun '05  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 22 Sep 2002
Editor: Chris Maunder
Copyright 2002 by Nir Dremer
Everything else Copyright © CodeProject, 1999-2009
Web21 | Advertise on the Code Project