Click here to Skip to main content
13,054,779 members (71,449 online)
Click here to Skip to main content
Add your own
alternative version


87 bookmarked
Posted 19 Sep 2002

File Encryption Utility

, 22 Sep 2002
Rate this:
Please Sign up or sign in to vote.
File Encryption Utility based on Blowfish Encryption Algorithm.
<!-- Download Links --> <!-- Article image -->

Sample Image - FileEncryption.jpg

Introduction<?xml:namespace prefix = o /><o:p>

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.<o:p>

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

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 .<o:p>


File Encryption Utility Has the following features:<o:p>

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


The File Encryption utility is writen in native C++ using ATL only for windowing classing.<o:p>

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


File Encryption Utility is divided to few small projects:<o:p>

  • 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.<o:p>
  • Enc_Blowfish – Blowfish encryption implementation (based upon Bruce Schneier and Jim Conger implementation).<o:p>
  • SelfExtract – Self Extracting executable "header".<o:p>
  • GenLib – Small Library holding all commonly used items in other project parts.<o:p>
  • Builder – Small Console utility for creating the final File Encryption Executable.<o:p>

GenLib – The General Library<o:p>

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.<o:p>

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

  • GenFiles – Openning OpenFile/SaveFile and OpenDirectory Dialog Boxes.<o:p>
  • SelfExtract – Creating Self-Extracting Executable.<o:p>
  • 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).<o:p>
  • FileWipe – Wiping a File from Hard Drive.<o:p>

All those classes are under the GenLib namespace.<o:p>

Additional Encryptions<o:p>

Inside the FileEnc project there's an interface called EncryptionInterface – implementing this interface can allow you to easily change the encryption the utility uses.<o:p>

Implementing this interface requires only stream cipher implementation and saves all the overhead of working with files.<o:p>

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.<o:p>


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

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).<o:p>

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.<o:p>


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.<o:p>

The file encryption is based upon the password length - larger passwords equal better security.<o:p>

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


Blowfish encryption algorithm -

Revision History

23 Sep 2002 - Initial Revision


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


About the Author

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

You're welcome to visit his photography site:

You may also be interested in...

Comments and Discussions

Questionnice project to study Blowfish Pin
Member 879424217-Jun-12 5:41
memberMember 879424217-Jun-12 5:41 
QuestionHash algorithm Pin
univmalik4-Apr-12 6:49
memberunivmalik4-Apr-12 6:49 
GeneralBug Pin
MeriInssi14-Nov-10 5:10
memberMeriInssi14-Nov-10 5:10 
GeneralRe: Bug Pin
Nir Dremer15-Nov-10 5:13
memberNir Dremer15-Nov-10 5:13 
GeneralMy vote of 1 Pin
mathgeek543-Apr-09 8:37
membermathgeek543-Apr-09 8:37 
QuestionAES Encryption Pin
Member 228457121-Sep-08 19:31
memberMember 228457121-Sep-08 19:31 
AnswerRe: AES Encryption Pin
Nir Dremer21-Sep-08 21:19
memberNir Dremer21-Sep-08 21:19 
GeneralRe: AES Encryption Pin
Member 228457123-Sep-08 23:00
memberMember 228457123-Sep-08 23:00 
GeneralRe: AES Encryption Pin
Nir Dremer24-Sep-08 21:22
memberNir Dremer24-Sep-08 21:22 
GeneralRe: AES Encryption Pin
Presu26-Sep-08 1:13
memberPresu26-Sep-08 1:13 
GeneralRe: AES Encryption Pin
Nir Dremer26-Sep-08 8:40
memberNir Dremer26-Sep-08 8:40 
GeneralProgress bar incorrect Pin
damir_tk26-Nov-06 10:14
memberdamir_tk26-Nov-06 10:14 
GeneralRe: Progress bar incorrect Pin
Nir Dremer26-Nov-06 11:11
memberNir Dremer26-Nov-06 11:11 
GeneralRe: Progress bar incorrect Pin
damir_tk26-Nov-06 11:28
memberdamir_tk26-Nov-06 11:28 
Generalwiping is not that secure Pin
Billiebub14-Nov-06 9:58
memberBilliebub14-Nov-06 9:58 
GeneralRe: wiping is not that secure Pin
Nir Dremer22-Nov-06 6:16
memberNir Dremer22-Nov-06 6:16 
GeneralNeed an idea Pin
sudha_sen19-Oct-06 19:05
membersudha_sen19-Oct-06 19:05 
GeneralRe: Nice one :) Pin
Nir Dremer24-Mar-06 4:43
memberNir Dremer24-Mar-06 4:43 
Questionfile folder security Pin
salehbk15-Oct-05 22:15
membersalehbk15-Oct-05 22:15 
Generalwant DLL Pin
bhavik.dpr13-Oct-05 3:24
memberbhavik.dpr13-Oct-05 3:24 
GeneralRe: want DLL Pin
Nir Dremer13-Oct-05 3:34
memberNir Dremer13-Oct-05 3:34 
GeneralRe: want DLL Pin
bhavik.dpr13-Oct-05 18:32
memberbhavik.dpr13-Oct-05 18:32 
GeneralRe: want DLL Pin
Nir Dremer13-Oct-05 19:14
memberNir Dremer13-Oct-05 19:14 
GeneralRe: want DLL Pin
bhavik.dpr13-Oct-05 19:22
memberbhavik.dpr13-Oct-05 19:22 
GeneralRe: want DLL Pin
Nir Dremer13-Oct-05 21:16
memberNir Dremer13-Oct-05 21:16 
GeneralRe: want DLL Pin
Nir Dremer13-Oct-05 21:16
memberNir Dremer13-Oct-05 21:16 
GeneralRe: want DLL Pin
bhavik.dpr13-Oct-05 22:47
memberbhavik.dpr13-Oct-05 22:47 
GeneralRe: want DLL Pin
Nir Dremer14-Oct-05 5:43
memberNir Dremer14-Oct-05 5:43 
Generalcompile Pin
thanhthuyvn_vtajkhskjakjd15-Jun-05 14:35
memberthanhthuyvn_vtajkhskjakjd15-Jun-05 14:35 
GeneralRe: compile Pin
Nir Dremer15-Jun-05 19:20
memberNir Dremer15-Jun-05 19:20 
GeneralBIF_NONEWFOLDERBUTTON : undeclared identifier !!! Pin
mohsen nourian6-Mar-05 20:33
membermohsen nourian6-Mar-05 20:33 
GeneralRe: BIF_NONEWFOLDERBUTTON : undeclared identifier !!! Pin
The_Mega_ZZTer21-Oct-05 15:08
memberThe_Mega_ZZTer21-Oct-05 15:08 
GeneralRe: BIF_NONEWFOLDERBUTTON : undeclared identifier !!! Pin
maroed14-Nov-06 12:23
membermaroed14-Nov-06 12:23 
QuestionHow to hide/encrypt folder Pin
Hamzak28-Nov-04 2:43
memberHamzak28-Nov-04 2:43 
AnswerRe: How to hide/encrypt folder Pin
purpureleaf13-Apr-05 23:20
memberpurpureleaf13-Apr-05 23:20 
GeneralNot work for zip files Pin
Wyz8-Sep-04 17:58
memberWyz8-Sep-04 17:58 
GeneralRe: Not work for zip files Pin
Anonymous8-Sep-04 22:05
sussAnonymous8-Sep-04 22:05 
GeneralRe: Not work for zip files Pin
The_Mega_ZZTer21-Oct-05 15:13
memberThe_Mega_ZZTer21-Oct-05 15:13 
GeneralRe: Not work for zip files Pin
damir_tk19-Nov-06 8:45
memberdamir_tk19-Nov-06 8:45 
Generalmultiple file decryption Pin
slindquist@benchmktg.com12-Aug-04 3:59
memberslindquist@benchmktg.com12-Aug-04 3:59 
GeneralRe: multiple file decryption Pin
Nir Dremer18-Aug-04 21:33
memberNir Dremer18-Aug-04 21:33 
QuestionHow to hide files Pin
KmAshif19-Jun-04 23:03
memberKmAshif19-Jun-04 23:03 
AnswerRe: How to hide files Pin
Nir Dremer19-Jun-04 23:16
memberNir Dremer19-Jun-04 23:16 
GeneralRe: How to hide files Pin
KmAshif19-Jun-04 23:50
memberKmAshif19-Jun-04 23:50 
GeneralRe: How to hide files Pin
Nir Dremer20-Jun-04 1:31
memberNir Dremer20-Jun-04 1:31 
AnswerRe: How to hide files Pin
lszhangDream29-Sep-04 4:02
memberlszhangDream29-Sep-04 4:02 
AnswerRe: How to hide files Pin
The_Mega_ZZTer21-Oct-05 15:18
memberThe_Mega_ZZTer21-Oct-05 15:18 
GeneralCompression and encryption Pin
Anthony_Yio23-May-04 19:36
memberAnthony_Yio23-May-04 19:36 
GeneralRe: Compression and encryption Pin
Nir Dremer23-May-04 21:51
memberNir Dremer23-May-04 21:51 
QuestionLicensing &amp; Export? Pin
Anonymous27-Apr-04 20:28
sussAnonymous27-Apr-04 20:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170713.1 | Last Updated 23 Sep 2002
Article Copyright 2002 by Nir Dremer
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid