BilboCrypt v0.97                         6. 9.2005
programmed by Martin "Bilbo" Petricek <bilbo@centrum.cz>
--------------------------------------------------------

 This program is covered by GNU GENERAL PUBLIC LICENSE (see file gpl.txt).
 This program comes with full source code.
 This program exist in DOS and Windows version
 If you don't have the source code, you can download it from:
     http://www.petricek.net/
 I cannot guarantee that your files will be absolutely safe with this
 program, however the security level is so high that your files will
 be probably safe for many years from cryptography experts
 and forever from anyone else (if you pick good password). 

 Thanks to David Barton (for DCPCrypt) and Ing. Pavel Novy, SVTI FEL (he
 got some of my files without my consent, thus forcing me to write this)

Configuration file
------------------
 BilboCrypt tries to load a configuratuion file at startup.
 Each line is interpreted as one parameter that is prepended
 before ordinary parameters. Useful especially for specifying language,
 but you can set other parameters too.
 Any line not beginning with dash (-) is ignored.
 BilboCrypt looks for file "bca.cfg" in following directories
  1. $HOME (environment variable HOME)
  2. "Application data" directory in your profile (Windows only)
  3. Directory where BilboCrypt binary is placed
  4. /etc (Linux only)
 Only the first configuration file found is used.

Usage
-----
 Usage is somewhat similar to compression programs like arj, rar, ace,
 uharc, 7zip ...
 Advantage is that with this program is NOT POSSIBLE to find what files
 are there in the archive, or how many of them are there, only total
 estimate size of all files in archive. It's not good if anyone find file
 for example my_mistresses.txt, even worse if it is your wife...
 This cannot happen with this program.

 Test encrypted archive    : bca t <archive.bc>
   This will test archive (decrypt files without writing them to disk).
   You must know the password.

 Extract encrypted archive : bca x <archive.bc> [target_directory]
   This will prompt for password and try to extract archive (if the
   password is invalid you may end with garbage and/or error message,
   otherwise you will end up with the files you have put in the archive)

 Create encrypted archive  : bca a <archive.bc> [filemask(s)...]
   This will prompt for password (twice) and create crypted archive
   
 Entropy generator       : bca g <archive.bc> <file_size> <entropy_bytes>
   This will create "fake archive". The size of archive is <file_size> bytes
   and <entropy_bytes> (default = 64) is number of bytes you must generate by
   hitting randomly some keystrokes. The program measure the interval between
   keystrokes and the keys pressed and construct randomness from it.
   It can be used to confuse people trying to get your files. If you use
   entropy_bytes from about 48 to 72, it may confuse even experienced experts,
   since they won't be able to recognize it as a fake archive.
   The fake archive is undistinguishable from the normal one, except that it
   contain random garbage in place of the encrypted data. And if you try to
   decrypt garbage, you will get only another garbage, regardless of password.

 Archive information     : bca i <archive.bc>
   Only fist 12 to 18 bytes (header) are unencrypted. By using this you can
   see what anyone can know without password (just the method of encryption
   and whether it contain CRC or Self-exec)

 Disk Wipe		 : bca w [disk]
   Clears all free space on given disk (path) or current disk if no
   parameter given. This will cause that all deleted files on wiped
   disk will be unrecoverable by utilities like undelete (since all
   free space possibly occupied by them was overwritten) However
   beware that this wipe does not protect from opening physically
   the disk and studying the surface for remanent magnetic field (and
   recovering the data this way). But such recovery is very expensive
   (You need expensive equipment, magnifying glass is not enough :o).
   Improved wipe processes (multiple times and with random data)
   will be introduced in next versions of BilboCrypt.
   This function doesn't do anything to "normal" (not deleted) files.
   This work on disk with any size. 2 Gb is not a limit...

 File Wipe               : bca f [filemask(s)...]
   Causes specified files to be overwritten by zeroes, so their
   content cannot be recovered by utilities like undelete.
   After wiping the files are deleted.  With -r you can do recursive
   wipe that will also delete subdirecotries and files in them.
   Files up to 2Gb large are supported

Switches:
 -l[language]
    Switch language used in program. Valid identifiers are:
    en     english
    cs     czech, no diacritics
    cz1    czech, windows-1250 encoding
    cz2    czech, iso-8859-2 encoding
    cz     czech, platform specific (windows-1250 on windows, iso-8859-2 on
           linux, no diacritics on dos)
 -b[n] Set amount of messages printed
     2 show only errors and warnings
     1 normal amount of messages, do not print progressbar
     0 normal amount of messages, including progressbar (default)
    -1 print also debugging messages (mostly useless)
 -d Do not delete files after wiping (disk and file wipe). They will be
    left on disk (but they will be overwritten by zeroes)
 -v2 be compatible with older version.
    If you specify this switch, you can create archives compatible with older
    versions (0.81 and older), but cannot use some new features (like storing
    attributes and file dates...). Archives from older versions (0.81 and
    earlier) still can be read in 0.90 and newer versions. 
 -w[password] Use [password] as encrypt/decrypt password.
    Beware, between -w parameter and the password must not be space!
    This will use password specified on commandline and will not ask for it.
    But I have to warn you: if you enter password on commandline, it will
    probably get to some history of recently used commands. So use it only
    if this history is not saver or it does not exist, or when you know how
    to clear this history. Otherwise, the password will remain there and there
    is risk of someone noticing it there (especially on public computers
    in schools, libraries, etc ...).
 -r recurse subdirectories
    This will cause recursive adding of directories and files in them.
    But it won't add empty directories (Those which haven't any files
    within them or within their subdirectories. This should be fixed
    in next version)
    Warning: support for subdirectories have only BilboCrypt 0.80 or newer
    If you want to decrypt files from archive containing directories with
    older version of BilboCrypt, you need to create the directory tree
    manually first.
 -i add directories to archive
    This will cause directories itself (not files in it) to be added to archive
    With this you can add even empty directories to archive with their attributes
    Warning - archive created with this option cannot be extracted with
    BilboCrypt 0.96 or older
    Use with -r to add files in subdirectories too
 -n don't add crc
    Don't add encrypted CRC checksum
 -s[file] add Self-Exec file (max 8 Kb)
    Add self-executing file.
    The file should be smaller or equal to 8192 bytes
    Each line will be executed by command.com or whatever is set in COMSPEC
    variable, so there may be some security hazard - you should execute only
    trusted programs this way. In Linux, /bin/sh -c [command] is executed.
    Line preceded by + will be executed AFTER the archive is decrypted.
    Only one such line is allowed per file.
    Example: +final.bat
    This can be used as "Secure batch files"
    Or if you distribute encypted software, you can put some installation
    script here.
 -x create SFX archive
    Create self-extracting archive (of course you will still need the
    password to extract the files)
 -p[path] add path to archive file names.
    This will append [path] to any filename stored in archive.
 -e[bytes] add entropy
    This will add random characters to the end of archive (also encrypted)
    This makes impossible to find end of archive and harden any cryptoanalysis.
    The number of characters added will be chosen at random in range
    (1/2*[bytes], 1*[bytes]), if no number is specified, [bytes] will be
    equal to 512. This switch is off (no entropy added) by default.
 -u[(b|c|r|t)...] user defined encryption
    b is Blowfish, t is Twofish, c is Cast128, r is Rijndael (AES)
    Just paste the characters together, they will make the encryption order
 -y or -y+ always say "yes" to all queries
 -y- always say "no" to all queries
 -[0|1|2|3|4] number of encryption passes (default=1)
    -0 means no encryption and is usable only for debugging or testing.
       NEVER USE -0
    -1 is default (Blowfish) - equal to -ub
    -2 is Blowfish and Cast128 - equal to -ubc
    -3 is -2 plus Rijndael (AES) - equal to -ubcr
    -4 is -3 plus Twofish - equal to -ubcrt
    You should use -1 or -2 if you really fear about revealing your files.
    -3 and -4 are quite slow and won't add much extra security. Even the -1
    may be unbreakable in the forseeable future

  The 576 bit key is generated by three hash function (HAVAL, SHA1, RMD160)
  from the password and concatenated together. Each cipher take some part
  of the key and use it to encrypt/decrypt (for details see the source code)

  Before encrypting, the key is encrypted with hash of the key, thus generating
  a new key. This process is repeated for 1/9th of second. Anyone who try to guess
  passwords to break into archive cannot skip this computations with the
  key (thus he can't try more than 9 passwords per second, if he have computer
  with computing power equal to yours - ideally, since after computing the key
  he must decrypt the archive and check if the key was good).

 Blowfish use 448 bits
 Cast128 use 128 bits
 Rijndael (AES) and Twofish use 256 bits

  If whole hash is used, then some bytes of the hash will be reused, (this
  is also reason why -3 and -4 offer only very small extra security over
  -2), but the key is NEVER exactly the same
  After generating the hash, the password is filled with zeros in memory.
  After the encryption/decription is done, ALL data related to BilboCrypt
  are filled with zeros in memory, so you will not leave any parts of
  password or encryption key or encrypted files in memory for anyone to see.

  Maximal password length is 255 characters and it is case-sensitive. It
  can contain any characters, except ESC (27), ENTER (13) and BACKSPACE (8),
  although entering some special characters in password (under 32 and over
  128 might be complicated or impossible, since they are not on the
  keyboard ...).
  All ciphers work in CBC mode.

Note that the password is the weakest part of the security. If you pick
something like "beer" it will be bruteforced or guessed quite easily.
You should pick up any password/pass phrase that is not in any dictionary
and it should have at least 12 characters, preferably containg numbers,
and MixED cASe or special symbols. The security of your files depend on the
quality of your password and concealing of your password (don't tell it
anyone, don't write it anywhere)
Note:
 Optimally should your password have at least 97 characters while using
 upper/lowercase letter and numbers to use whole strength of 576 bit key.

BilboCrypt returns exit code:
 0 - All ok
 1 - Program was interrupted by user action
 2 - Invalid parameters on commandline
 3 - Error when writing to disk
 4 - Error when reading from disk
 5 - Error in archive
 6 - Probably bad password, but can be an error in archive
 255 - Other (unknown) error

Changelog
---------

 0.97
  Fixed bug when unpacking or overwriting read-only files
  Added option to add directories to archive (even empty ones), not just files in them
  Archive created with this option won't be compatible with older BilboCrypt versions
  Added parameter -b
  Fixed some minor errors

 0.96
  Added File Wipe function
  Corrected problem when upacking archives with directories
  created on windows to linux and vice versa.
  Language now switchable at runtime instead of compiletime  (parameter -l)
  BilboCrypt now looks for configuration file (see documentation)
  Removed bug when archive became corrupted if you try to add unreadable file to it
  Some small bugfixes in user interface

 0.95
  Removed bug with disk wipe - up to 256K of disk space could be
  left unwiped. Now all free space is wiped properly.
  Removed bug when using -w parameter

 0.93
  Removed bug - not preserving attributes and modified time in windows
  and linux version.
  Preserving creation and access time too, in linux also
  permissions, uid and gid of the files
  Progress indicator now in encryption, decryption and disk wipe
  Reorganisation of help and minor code changes

 0.92
  Removed bug with pressing special keys (Shift, etc...)
  while entering password
  Fixed missing export in DLL version and you can now specify
  encryption order in bc_encryptdata/bc_decryptdata functions

 0.91
  Corrected bug in free space wipe
  Decrypting or testing of archive can be interrupted
  Other minor bugs fixed (-0 and self-exec work properly) 
  added three new functions to the library (bca.dll, libbca.so)
  First linux version released!

 0.90
  File format changed: BilboCrypt can store attributes and time/date of files,
  also improved strength against brute force attack (guessing passwords).
  You can still read (and create) old version archives
  Windowed GUI version. Still not the best GUI available.
  DLL support. You can call BilboCrypt from your programs.
  Some minor bugs fixed and many minor improvements.

 0.81
  Corrected typo in help
  Disk wipe shows time elapsed
  BilboCrypt sets exit code
  Password can be set on commandline
  Other minor improvements

 0.80
  Added disk wipe function
  (wipe already deleted files so they cannot be undeleted)
  Support for encrypting directory structures

 0.72
  Fixed three small bugs

 0.71
  Fixed Win32 version CTRL-Break handling

 0.70
  Program will ask whether to everwrite file or not instead of quitting,
  added -y and -y- options (always yes, always no)
  Corrected some minor error in entropy generator (it created file 1-4 byte
  larger than it should) and other minor changes

 0.65
  First released version

If you have any idea how to improve security or anything else,
send your comments to bilbo@centrum.cz
