FileCode 3.0
============


Contents
--------

1) Legal Stuff
2) Introduction

3) Quick Start  <---- If you just want to start USING FileCode, go here next!

- Detailed use and functions of FileCode --

4) Basics of Passwords/Passcodes
5) Entering
     i) Passwords
    ii) Passcodes
6) Selecting Source Data
7) Selecting Target Directory
8) Drag and Drop
9) Command Line Options

10) Miscellaneous Options
11) Other Information
12) History of FileCode and Conclusion


----------------------------------------------------------------
Section 1 - LEGAL STUFF (Please Read)
---------------------------------------------------

FILECODE 3.0 IS COPYRIGHT (C) 1998 MATTHEW BENNETT
ALL RIGHTS RESERVED. MATTHEW BENNETT IS THE AUTHOR OF FILECODE 3.0.

THE USER MUST ACCEPT THE FOLLOWING AGREEMENT:

DISCLAIMER:
"FILECODE 3.0 IS SUPPLIED AS IS. THE AUTHOR DISCLAIMS ALL WARRANTIES,
EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, THE FITNESS FOR ANY
PURPOSE.  THE AUTHOR ASSUMES NO LIABILITY FOR DAMAGES, INCLUDING THAT OF
LOST OR DAMAGED DATA, BE IT DIRECT OR CONSEQUENTIAL, WHICH MAY RESULT FROM
THE USE OF FILECODE 3.0."

FILECODE 3.0 REMAINS THE INTELLECTUAL PROPERTY OF THE AUTHOR.

THE FILECODE 3.0 EXECUTABLE AND ACCOMPANYING FILES (INCLUDING THIS FILE)
MUST IN NO WAY BE ALTERED BY ANY MEANS, AND SO MUST REMAIN EXACT COPIES
OF THOSE RELEASED BY THE AUTHOR.

FILECODE 3.0 IS RELEASED AS FREEWARE, SO NO CHARGE MUST BE MADE FOR THE
FILES THEMSELVES.

FILECODE 3.0 MAY BE FREELY DISTRIBUTED ACCORDING TO THE ABOVE AGREEMENT.

Any trade or registered names mentioned in this text are hereby acknowledged
to be the property of their respective owners.

----------------------------------------------------------------
Section 2 - Introduction
---------------------------------------------------


Nothing like a good amount of waffling legal blurb to start things off :)

FileCode 3.0 is the latest version of the *freeware*, powerful file encryption/decryption 
utility.

Using data created by your password (or passcode) it will shift the bytes in the file
(or files) in a way that can ONLY be re-aligned by using the correct password/passcode
again. There's a variety of ways to select your source files. These include selection
by the standard Windows file dialog box, selection by whole directory, drag and drop,
and command line options.  Remember, no reference to the correct code is stored anywhere
in the encrypted files, and so it cannot be worked out from simply looking at the file.

I think I've put far too much of my time into programming FileCode (and I'm stupid
enough to release the whole thing as *freeware*?!), but hey =)


----------------------------------------------------------------
Section 3 - Quick Start
---------------------------------------------------


In a hurry to get started eh? Can't be bothered to read through a load of dull, boring
meaningless, and unhelpful text?...
..Well, I can't when I'm eventually forced to open the readme, so here's a quick start.

1) Make sure "string code" is selected and enter in your password.
   Your password must first start with either a 1 or 2.  These two numbers are the
   'code type', and the opposite must be used when you want to *decode* your file.
   After you've entered the code type number, you can type in any password your want -
   but make sure you *remember* it!

   For example, any files encoded with:

   1password

   Can only be correctly decoded with:

   2password

2) Select your source files.  If you want to select only one file, or only a selection of
   files, then press the "select individual file(s)" button.  If you want to encrypt (or
   decrypt) *all* files in a directory then press "select all files in directory" (what
   a surprise ;)

3) Select your target directory.  When you select your source file(s), the target directory
   is automatically set to the directory of your source file(s).  This means the source
   files themselves will be altered.  However, if you want to keep your source files as 
   they were and have the altered files put in another directory, then select (or create)
   another target directory.

4) Create those targets! If you have "confirm code" checked, then FileCode will ask you to
   re-type your password. I would strongly recommend you have this checked if your password
   is hidden.  If your password is visible, make sure you at least check it's correct
   before you start.

That's it :) Everything should be fairly obvious how to use anyway - still, don't forget to
read on for other ways of using FileCode.  In fact, if you want an even quicker way of 
encrypting/decrypting files (especially for e-mail), why not check out the "drag and drop"
section?


----------------------------------------------------------------
Section 4 - Basics of Passwords/Passcodes
---------------------------------------------------


Passwords/Passcodes must consist of the following pieces of information:

* Code Type
* Code number A (taken from automatically from password)
* Code number B (also taken automatically from password)

The code type is always the first character you type in the code box, and is either a '1'
or a '2'.  The reverse code type that was used to encode a file must be used to decode it
back.


----------------------------------------------------------------
Section 5 (i) - Passwords
---------------------------------------------------


Passwords are the default code sort selected by FileCode, and are known as "String Codes".
As mentioned in the section above, all passwords (and passcodes) need a code type included.
This tells FileCode what way to alter the files, and the two numbers can be likened to an
"encrypt" and "decrypt" option.  For example, a file encrypted by:

1aardvarks-o-plenty

can ONLY be correctly decrypted by the password:

2aardvarks-o-plenty

Please note case and spaces (they are allowed - as is any character on your keyboard) must
be exactly the same.

After you give FileCode the code type, it will work out the other information from your
password itself.  Passwords are 'limited' to 8000 characters, but somehow I don't think
you'll need anything even remotely close to this ;)


----------------------------------------------------------------
Section 5 (ii) - Passcodes
---------------------------------------------------


These are known by FileCode as "Raw Codes", and are really pretty pointless :P
Instead of allowing FileCode to work out the two numbers it needs from your password, here
you 'hand-feed' it the numbers.  The only real advantage to this is the fact that you
can have access to the full range of available numbers without typing in long passwords.
Still, all passwords generate a unique number set anyway, and the number size plays very
little part in the encryption anyway.  But hey :)

OK.. Passcodes take the form:

A!B!C

Where 'A' is the code type (1 or 2), 'B' is any number from -2147483648 to +2147483647
and 'C' is another number within the same range as 'B'.

So, once again, a file encoded by:

1!12345!54321

can only be decoded by:

2!12345!54321

Please note that is it not recommended that you set the 'B' number between -10 and 10, as
in some cases areas of the file may still be readable (obviously the file will still be
unusable if it is a program file).  Still, never use a 'B' number of 0, or the source will
remain unchanged.

Remember to ensure 'Raw Code' is selected before using Passcodes, otherwise it will be
treated as a string password.


----------------------------------------------------------------
Section 6 - Selecting Source Data
---------------------------------------------------


As explained in the quick start section, you can select your source files in a variety of
ways.  However, the two obvious ways are by pressing "Select individual file(s)" (Alt-I)
or "Select all files in directory" (Alt-D).

Selecting individual files will bring up a standard file-open box. You can either type or
select one file, or by holding down CONTROL you can click on multiple files.  To select a
range of files, click the first on, hold down SHIFT, and click the last one.  Press 'open'
to use select them and return to FileCode, or 'cancel' to forget it and go back. Please
note you can only select existing *files*, and not directories. Multiple directory
encryption/decryption is not currently supported.

If you want to select ALL files in a directory, for easy of use you can use the other
option, and simply choose your directory. Only the files in that directory's root will be
used - it will not recurse to other directories inside it.

If one file is selected, it will be shown by name in the source information box - otherwise
the number of files will be shown. By clicking on the source information box, you can use
the cursor keys to scroll the information if it is too big to fit in (if a very long path
and/or filename is selected for example).

There are two other ways of selecting source files - by the command line or by drag and
drop. See the relevant sections for details.


----------------------------------------------------------------
Section 7 - Selecting Target Directory
---------------------------------------------------


This, unsurprisingly, is not exactly tricky ;)
As said in the quick-start section, when you select your source file(s), then the target
directory will automatically be se to the same on as your source files are in. FileCode in
this way assumes you will want to directly alter your source files.  However, if you'd
rather have the altered files placed in another directory (leaving your source files
unchanged) then select it ('Select', Alt-L) or create a new one (err.. 'Create', Alt-E).


----------------------------------------------------------------
Section 8 - Drag and Drop
---------------------------------------------------

Windows allows you to select files and 'drag' them by clicking on the file and holding
down the (usually) left mouse button while moving the mouse - hence 'dragging' the file.
So, to speed things up, wouldn't it be a good idea if you could just select your source
files, drag them onto the FileCode icon (either on the desktop as a shortcut or the 
filecode.exe itself as seen in Explorer or equivalent) and those files would instantly be
selected by FileCode?

Yup, well, I thought so too :)

Ha! All those smug little commercial programs that flash "drag and drop capability" about -
well, FileCode can do that as well now :D

By default (as usual), the directories of the files dragged in will be selected as the
target, but you can still change it as normal.

This could be particularly useful for those wanting to encode their e-mail messages.. you
can do it quickly and easily buy just:
1) Right-click on the desktop, select new-->text document
2) Give the new text file a name, double click it and write your message.
3) Save the file and close the text window
4) Drag the little notepad icon to FileCode
5) Type in your password and press "Create Target" (Alt-T)
6) Exit FileCode - and there you are - your message has been encoded :)

You can then attach it to your e-mail, and the receiver simply has to drag that message
onto their own FileCode icon, type in the correct password, create the target, and read!


----------------------------------------------------------------
Section 9 - Command Line Options
---------------------------------------------------


Do you run an automated process, probably during the night, that you'd like to include
file encryption/decryption in? Say, do you download FTP files and would like them
encrypted afterwards?

No problem - just get your schedule program to call up FileCode and give it all the
information it needs through the command line :)

Type filecode /? for a list of commands. You'll see:


"FileCode Command Line Options

/?				Display this help message
/s "c:\files"			Select source directory
/f "file1.ext" "file2.ext"	Select source files
/t "c:\encrypted"		Select target directory
/p "1password"			Password/Passcode
/r				Raw Code
/h				Hide Code

If the target directory is not specified, then FileCode will assume you want to over-write
your source files (the target directory will match the source directory). If the source
directory is not specified, then the directory FileCode is running in will be used. If no
source files are specified, then ALL files in the source directory will be altered. Please
note that you cannot leave out source directory AND source files. If Raw Code is not
specified, then FileCode will default to String Code.  If Hide Code is not specified, then
the code will be visible."

..That just about says it all really. Here's some example command lines:

* Encrypt all files in c:\wibble with the password 1aardvark
filecode /s "c:\wibble" /p "1aardvark"

* Encrypt thing1.exe and info.txt in c:\myfiles\area1 with a password of 1password and
  place the encrypted files in c:\encrypted
filecode /s "c:\myfiles\area1" /f "thing1.exe" "info.txt" /t "c:\encrypted" /p "1password"

* Decrypt stuff.zip in c:\windows with a raw code of 2!123!456 and hide the code
filecode /s "c:\windows"  /f "stuff.zip" /p "2!123!456" /r /h

Note that the spaces in-between commands is shown simply to makes things clear, and is not
necessary when actually entering the command line.  FileCode quits automatically when the
file alteration process is complete.

Please remember that (mainly for safety reasons) FileCode will not delete your source
files - even if the target directory is different.  If you want this then simply delete
them afterwards with your schedule program or by hand.


----------------------------------------------------------------
Section 10 - Miscellaneous Options
---------------------------------------------------


As previously mentioned, your code can be hidden by simply checking the "hide code" box in
FileCode. This will show your code as a series of asterisks (*'s).  If you select
"confirm code" then FileCode will ask you to retype your password/passcode when you ask to
create a target.  This is to ensure the correct password/passcode is used - as it cannot
be found from the file itself afterwards!  It is possible to toggle "hide code" on and off,
showing and hiding the code information.  The 'confirm code' box will mirror the code hide/
visible options previously set.

All changes to these options that you make are automatically saved when you exit the
program.

All buttons and boxes in the main dialog area can be selected by pressing and holding alt
followed by the underlined letter on the button or box you want to select.  This is mainly
to allow experienced users to operate the program quickly.


----------------------------------------------------------------
Section 11 - Other Information
---------------------------------------------------


The largest file FileCode can encrypt/decrypt is.. wait for it.. just over 4 gigabytes.
I should hope this wouldn't be too much of a problem for the majority of users ;)
(If, for some bizarre reason, you *actually* needed to alter a file larger than this,
just find a nice little utility to split it up into smaller chunks...)

It's possible to encrypt a file more than once, and even with different passwords each
time. However, there is little reason to as one encryption is certainly secure enough, and
so the extra effort and possible confusion from doing this isn't really worth it. Still..
I just thought I'm mention it anyway.. :)


FileCode is written mainly in C (with a healthy addition of C++ in parts) using notepad 
(wwaahhheeyyy!! But I had to switch over to WordPad when the source became too big to allow
cut and paste options ;) and was compiled using the excellent MinGW32 (you can thank the 
ridiculously small file size mainly to this compiler!)

As I've had a surprisingly large number of requests for MinGW32 info, you can get it at:

http://agnes.dida.physik.uni-essen.de/~janjaap/mingw32/

Whilst on the subject of WWW addresses, don't forget the FileCode homepage:

http://www.btinternet.com/~bennett/filecode.html

It'll contain the latest information on any FileCode 4.0's... (though after what I've put
into this version I doubt there's much more I can do ;)


******************************************* <---------

Please do feel free to e-mail me on bennett@btinternet.com with any questions, or
(pplleeaassseee nnnoooo ;) bug reports or suggestions.
I'd also be grateful for you to mail me just saying what you think of FileCode, so at least
I know people are using it :D

******************************************* <---------


----------------------------------------------------------------
Section 12 - History of FileCode and Conclusion
---------------------------------------------------


PPPHHEEEWWW!! At last - FileCode 3.0 is finished!!
Just *how* many hours have I put in to this program? You wouldn't have thought so - after
all, all it does is play about with a file's bytes. Still, the TIMES I've spent looking for
information on the Microsoft Support web site (how to get that "Browse for Folder" thing
working, and how to pre-select what directory it opens at took long enough ;) but still -
it's all done now :)

Having said that, I've enjoyed every minute of it (well.. almost ;) - as I hope you will
too.

Here's a brief, rather vague history of FileCode:

FileCode 0.0
Written in BASIC many years ago. All it did was allow you to type in something on the
screen, and it would print out the 'encrypted' version of your text. Humm...

FileCode 0.5
Written in Pascal, again, many years ago. It could just about encrypt files (using a
Passcode-type code only) but had an annoying bug that I just couldn't figure out that
only altered every-other byte in the file...

FileCode 1.0
First Windows version of FileCode, written in C.
You thought FileCode 2.5 was basic? You should have seen this... ;)

FileCode 2.0
A few good features added, including an enhanced (actually 50-100 times faster) encryption
engine, password option and the ability to use a standard Windows file-open box.

FileCode 2.5
First version to be released to the public. Still pretty basic, but hey - it worked:)
Still could only manage one file at a time though..

FileCode 3.0
Wow - what a difference :)
Many more features added - a lot of them suggested by users of FileCode 2.5 (such as the
ability to hide/show your code, and the command line options)
Multiple file encryptions/decryptions (at last!) and it looks cool(er) than before ;)




A few things that *could* be added to FileCode, but that I really don't think are a good
idea anyway (otherwise I'd have put them in ;):

* OK, OK.. all these commercial programs have the ability to create nice, cute little
  "self-decrypting" exe's. But firstly, considering *everyone* should have a copy of
  FileCode <grin> what's the point? It just makes the files bigger (a pain for e-mails)
  and the fact that you don't really want to double-click your way through a load of
  files to decode them anyway... which brings me on to;

* Making little encrypted "archives" that store your files. Erm.. I suppose that wouldn't
  be too bad, but why not just get FileCode to encrypt all your files into their own
  directory, and zip them up? It's interesting to note that if you try and zip up a file
  encoded by FileCode, very little or no size reduction will be made. This shows just how
  well FileCode messes up the original file - as winzip can't find any repetitions in the
  file, so can't compress it...

So - those two are possible, but - In My Humble Opinion - it's not really needed...


I really can't believe I've just sat here and written out all this.....

I think I should get out more.. ;)



I hope you find FileCode easy to use and useful :)


Matt

10:30PM - 27th May 1998