home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
High Voltage Shareware
/
high1.zip
/
high1
/
DIR4
/
SECDRV10.ZIP
/
SECDRV.DOC
< prev
next >
Wrap
Text File
|
1993-11-19
|
11KB
|
227 lines
SecureDrive V1.0 Documentation
Mike Ingle <mikeingle@delphi.com>
The code which I wrote is not copyrighted, but the program contains GNU
Copylefted code, and therefore may be freely distributed under the terms of
the GNU General Public Licence. See file COPYING for legalese.
All references to MD5 refer to:
RSA Data Security, Inc. MD5 Message-Digest Algorithm
(C) 1990, RSA Data Security
The IDEA(tm) block cipher is covered by a patent held by ETH and a Swiss
company called Ascom-Tech AG. The Swiss patent number is PCT/CH91/00117.
International patents are pending. IDEA(tm) is a trademark of Ascom-Tech AG.
There is no license fee required for noncommercial use. Commercial users
may obtain licensing details from:
Dieter Profos, Ascom Tech AG, Solothurn Lab, Postfach 151, 4502 Solothurn,
Switzerland, Tel +41 65 242885, Fax +41 65 235761.
Use this software at your own risk!
Send all comments and bug reports to <mikeingle@delphi.com>
Many people have sensitive or confidential data on their personal computers.
Controlling access to this data can be a problem. PC's, and laptops in
particular, are highly vulnerable to theft or unauthorized use. Encryption
is the most secure means of protection, but is often cumbersome to use. The
user must decrypt a file, work with it, encrypt it, and then wipe the
plaintext. If encryption were easy, many more people would use it.
SecureDrive is a step in this direction. SecureDrive automatically stores
sensitive data on your DOS/Windows system in encrypted form.
SecureDrive allows you to create an encrypted partition on your hard drive.
It also allows you to encrypt floppy disks. Encrypted partitions and disks
become fully accessible when the TSR is loaded and the proper passphrase
entered. The TSR takes only 2K of RAM. Encryption is performed at the sector
level and is completely transparent to the application program. Everything
on the disk or partition except the boot sector is encrypted. Encrypted
floppy disks can be freely interchanged with unencrypted ones. Disks and
partitions can be decrypted and returned to normal at any time.
SecureDrive uses the IDEA cipher in CFB mode for maximum data security. The
MD5 hash function is used to convert the user's passphrase into a 128-bit
IDEA key. The disk serial number, and track and sector numbers are used as
part of the initialization to make each sector unique.
SecureDrive is made up of three program files. SECTSR is the memory-resident
driver. CRYPTDSK is used to encrypt and decrypt floppy disks and hard drive
partitions. LOGIN is used to unlock encrypted disks and partitions by
loading the passphrase and disk parameters into the resident module.
Getting started instructions:
If you only have one hard drive partition (C:), you will have to repartition
your hard drive if you want an encrypted partition. You can use encrypted
floppies without changing your hard drive. You should create a partition
large enough to hold all of your sensitive data. For this example, assume
the partition is (D:). Put SECTSR, CRYPTDSK, and LOGIN in a directory which
is in your PATH. (Not on the soon-to-be encrypted drive, of course!)
The partition can have data on it, or it can be blank. Run CRYPTDSK and
select the drive letter. Enter a passphrase. CRYPTDSK will now encrypt the
partition. It will skip bad sectors.
Now put in your AUTOEXEC.BAT, before the loading of any disk cache:
SECTSR
LOGIN D: /S (assuming drive D:)
This will load the TSR and put it in "safe mode", preventing accidental
access and damage to the encrypted drive. Reboot the system to make the
changes take effect. Now type
LOGIN D: (again, assuming drive D:)
and enter your passphrase. Your encrypted drive is now accessible.
To use an encrypted floppy, use CRYPTDSK to encrypt the floppy. Then run
LOGIN /F
and enter the passphrase. The encrypted floppy is now accessible. If you
entered the wrong passphrase, access will fail with a drive not ready error.
Detailed instructions:
Creating an encrypted floppy disk:
Insert any DOS-formatted floppy disk. The disk may contain data, or it may
be blank. Run CRYPTDSK. Select the floppy drive, and enter a passphrase. You
will be required to enter the passphrase twice to confirm. CRYPTDSK will now
encrypt the disk.
Accessing an encrypted floppy disk:
Load SECTSR, if it's not already loaded. Run LOGIN /F and enter the
passphrase used to encrypt the disk. The disk is now accessible. You can
swap disks at any time, as long as all of the disks are encrypted with the
same passphrase. You can also access unencrypted disks; SECTSR switches on
and off automatically. If you want to access a disk encrypted with a
different passphrase, type LOGIN /F again and enter the new passphrase. The
same passphrase applies to both floppy drives.
Decrypting a floppy disk:
Run CRYPTDSK. Select the floppy drive. CRYPTDSK will detect that the disk is
encrypted, and will prompt you to decrypt it. Enter your passphrase.
CRYPTDSK will now decrypt the disk.
Creating an encrypted hard drive partition:
You must have more than one partition, or more than one hard drive. If you
encrypt your C: drive, you will not be able to boot from it! If this
happens, decrypt it again to restore it. You should create a small D:
partition, large enough to store as much sensitive information as you plan
to keep on your hard drive. You can also run applications from the secure
partition, but there will be some speed loss. Back up your hard drive before
installing. Use FDISK to repartition your drive, and set up a small D:
drive, which will become your secure partition. You can copy data to it
before or after encryption. Run CRYPTDSK and select the letter of the
partition you want to encrypt. CRYPTDSK will display the physical drive,
head, and cylinder of the boot sector of this partition. You should verify
these numbers. Then enter a passphrase to encrypt the partition. This will
take a few minutes, depending on the size of the partition and your CPU.
Preventing damage to the secure partition, which could be caused by writing
to it withot first logging in:
Load SECTSR. Run LOGIN D: /S to put the drive in safe mode. This should be
done in AUTOEXEC.BAT. Writes will be locked out. A drive not ready error
will occur if you attempt to access the encrypted drive. This will prevent
DOS programs from reading the drive. Windows behaves rather pathologically:
it retries the attempt about a dozen times, and then displays garbage. If
this happens, just close the window, log in, and try again. The drive is
still protected against writes in Windows.
Accessing an encrypted hard drive partition:
Load SECTSR, if it's not already loaded. Run LOGIN D: where D is replaced by
the letter of the encrypted partition. Type the passphrase. Your secure
partition is now accessible. Note that only one secure partition can be
accessible at a time. You can have encrypted floppies and a secure partition
active simultaneously, but you can't have two secure partitions. The TSR
only stores two cryptographic keys: one for the secure partition, and one
for encrypted floppies.
Decrypting a hard drive partition:
Reboot to clear SECTSR out of memory. Run CRYPTDSK, select the drive letter,
and enter the passphrase. CRYPTDSK will decrypt your partition.
Changing a passphrase:
Decrypt the disk with the old passphrase, and re-encrypt it with the new
passphrase.
Clearing keys:
Typing LOGIN /C will erase the cryptographic keys from memory and disable
encryption. You may then run LOGIN again to restore access. Note that this
does not erase plaintext from memory; turn the computer off to do this.
Using a disk cache:
You can use a disk cache such as SMARTDRV.EXE or NCACHE to speed up access.
The cache must be loaded after SECTSR is loaded. A .SYS cache will not work,
because it is loaded before the TSR. If the cache is loaded first, it will
cache ciphertext and provide little speedup. If the cache is loaded after
SECTSR, it will cache plaintext and speed up access.
Hazards to avoid:
Writing to the encrypted partition or encrypted floppies without logging in.
When you load the TSR and put it in safe mode, writes will be locked out.
However, if you access an encrypted disk without loading the TSR, the disk
can be destroyed. This happened to one of the beta testers. Use safe mode
and load the TSR in AUTOEXEC to prevent it.
Forgetting your passphrase. With any lock, there is the hazard of losing the
key. But cryptography is a special case because there are no locksmiths to
save you. If you forget a passphrase, you're out of luck. That data is gone.
Using his program without backups. It accesses disks at the low level of the
BIOS, and a program bug or an unfriendly interaction between the TSR and an
application could scramble your hard drive permanently.
Exporting this program. This program is for use in the US and Canada only.
Cryptography is export controlled, and sending this program outside the
country may be illegal. Don't do it.
Potential security problems:
Data leaks: swapfiles and temporary files. Many application programs create
swapfiles and temporary files all the time. If these files are written to a
non-encrypted disk, they will expose your data. This can be avoided by
putting the swapfiles and temporary files on the encrypted disk, but this is
slow. The best solution is to use a RAM disk or cache the encrypted disk.
There are also programs such as Norton WIPEINFO which will wipe empty space.
Trojans and viruses: someone could replace LOGIN with a hacked version, or
install a specially written Trojan on your system, and capture your
passphrase or key. Since the key remains in memory in the TSR, any program
could potentially swipe it. The only sure way to prevent this is to make
sure that nobody has the opportunity to install such a Trojan.
Passphrase guessing: if your passphrase is weak (a single word, monocase,
with no punctuation is very weak) an attacker could try to guess it. This
has proven highly effective against Unix login passwords. The best
passphrase is a phrase which does not appear in text or literature.
Backups: must be encrypted. Use encrypted disks, or use an encrypting
compression program such as HPACK and write the encrypted file onto the
backup tape. Do not leave unencrypted disks or printouts lying around.
Source code and modifications:
SECTSR.ASM is the self-contained source for SECTSR. Use TASM and TLINK /T to
assemble it.
CRYPTDSK uses SDCOMMON and CRYPT2.OBJ generated from CRYPT2.ASM. It also
uses MD5.C, which is from the PGP23A source code.
LOGIN uses SDCOMMON and MD5.C.
The programs were compiled with Turbo C++. Compile them large model.
If you make any interesting modifications or improvements, send me mail and
a copy of the new code. I hope this program will become popular and will be
modified and improved by the net.