Subscribe

Flash Lock for PCs

Posted by Circuit Labs on Thursday, November 13, 2008

  Author: Anthonie Botha

e05a068This system was designed to eradicate the anarchy that reigned on a school’s computers. Conventional
password protection could not be utilized and the old key lock was too easily tampered with and bypassed. Highly objectionable information was being downloaded from the Internet and files being deleted all the time. To no avail, the guilty party was always conveniently dead or in hyperspace! A failsafe physical lock was urgently needed with total control and hence the Flash PC Lock was born!

The PC Flash Lock device should have a lot of applications. For example, the author implemented this lock at a friend’s Internet café. Also, a small software company employs this versatile lock together with an OCX incorporated into their software to prevent pirating and multiple software installations. The author himself employs it on his PC’s to prevent his children from giving him heart failure when they “accidentally” destroy valuable source code. The software controlling the Flash Lock is a resident utility, hiding in the root of the operating system and waking up on startup. It also interfaces with the Flash Lock hardware via the serial port, exchanging data every second. For the person that is fanatical about security of his or her files, this is a cost effective solution. After an error, the system will shutdown (if that option was selected) allowing you 60 seconds to attempt to solve the problem. Instead of shutting your PC down, you can merely remove the Flash Lock. The device works on Windows XP machines only!

How does it work?
By using your computer, an open serial port and the Flash Lock software, written with Visual Basic 6 there are various options at your disposal. The circuit is very basic and will fit into a standard 9-pin serial port plastic housing. A hole can be made in the plastic housing and the Flash Lock fitted to a key ring. As you may have guessed at this point, the power behind the circuit is the software.

Hardly hardware
The circuit diagram of the PC Flash Lock, Figure 1, is down to a microprocessor, some passive parts and diodes. e05a068[3]The supply voltage to the microprocessor is limited to about 5.6 V by zener diode D2. As the RS232 port is specified to supply an internally limited maximum 20 mA of line current, no series resistor is required to keep the zener diode and the (PIC) from harm. The other diode in the circuit, D1, prevents the PIC supply voltage from becoming negative. The PIC I/O pins being used by the software are protected by 1-kΩ resistors. Admittedly that’s close to what a PIC can take for abuse but then the circuit has toe remain as simple and cheap as possible. Knowing from the PIC datasheets that the pins can sink or source up to 20 mA each, we get 12 V/1,000 Ω = 12 mA under worst case conditions so it’s cheeky but still within spec. This excess current will flow from the VDD or the GND pin, the zener diode acting as a sink. The oscillator inside the PIC16F628ASO chip operates at the frequency governed by an external 4-MHz ceramic resonator, X1.

Construction — wick it!
e05a068[5]The tiny printed circuit board designed for the Flash Lock is shown in Figure 2. With some force and possibly some strong words it  can be pushed between the pins of a 9-way sub-D socket (yes that’s the female version). Check if the case fits around the tiny board and if necessary trim the sides by filing. If you hate SMDs, you should know that the PIC chip also exists in a DIP case, hence the circuit may also be built on a piece of veroboard. You will, however, have a hard time fitting the lot in a 9-way sub-D connector shell. A lot has been said and written on the subject of soldering SMD parts and some advice is repeated here for the benefit of beginners. Absolute requirements for success in the SMD department include good quality tools, a clean desk and a steady hand. We’ll shortlist some more aspects below.

 Figure 2

* Use a low-power solder iron with a tip diameter of 1 mm maximum. Alternatively, use a larger tip and wind 1-mm solid copper wire around it.
*  The same applies to the solder tin — use the thinnest you can get —0.6 mm or 0.5 mm is recommended.
* Precision tweezers from specialised pharmacists — much smaller and accurate than the ‘pair of tongues’ you normally get at Woolworth’s.
* Desoldering braid (a.k.a. wick), if necessary with it its suction power boosted by a bit of colophonium.
* Fit the 0805-ca se components by first generously tinning one PCB pad. Using the tweezers and the solder iron, position the part and secure one end by pushing it into the solder. No extra tin is required at this point. Next, solder the other end. If necessary, reflow the solder at the first end.
* The IC is first aligned on its footprint, then secured by soldering one corner pin. Check the alignment of the other pins. If ok, solder the pin at the other side of the chip, and so on. Do not panic if adjacent pins get interconnected by excess solder — remove the solder by applying a length of fresh wick.

Finally, inspect your work using a magnifying glass. Tell your friends about it.

COMPONENTS LIST

Resistors:
(all SMD, 5%, case shape 0805)
R1,R2 = 22kΩ
R3,R4,R5 = 1kΩ

Semiconductors:
D1 = 1N4148, SMD, case shape 0805
D2 = zener diode 5.6V 500mW, SMD,
MiniMelf case
IC1 = PIC16F628A-I/SO, SO18 case,
programmed,
Publishers order code 050107-41*

Miscellaneous:
K1 = 9-way sub-D socket (female),
straight pins
9-way sub-D connector shell case
PCB, ref. 050107-1 from The PCBShop
CD-ROM, PIC source and hex code files,
PC resident software, Publishers order
code 050107-81* or free download
(approx. 20 MB)
Flash PC Lock Software Guide, free
download # 050107-12.zip
* See Elektor SHOP pages or
www.elektor-electronics.co.uk

PIC bit options
The PIC16F628A-SO to be used in this project needs to have its configuration bits programmed as shown below.

0 F OSC0: 1 xt oscillator
1 F OSC1 0 xt oscillator
2 WDTE 0 watchdog disabled
3 PWRTE/ 0 powerup timer enabled
4 F OSC2 0 xt oscillator
5 MCLRE 0 memory prot off
6 BOREN 1 brownout enabled

7 LVP 1 low voltage program enabled
8 CPD/ 1 data memory protection off
9
10
11
12
13 CP/ 1 code memory protection off

The software

e05a068[9] 

Figure 3. The first option in the PC software (device manager) allows you to read or change your username and password. This password is written to the EEPROM using “write to device”.

e05a068[11]
 e05a068[13]

Figure 5. After software installation, the Elektor Toolbar will be installed in the top of the screen. Left or right clicking on the icon will display the Accounts menu.

Figure 4. The fourth option (application manager) allows you to manage individual rights. The fourth option (application manager) allows you to manage individual rights.

  The simplicity of the PC Flash Lock hardware belies the sheer power and complexity of the associated software developed by the author.

The complete Software Guide available for this project comes as a free download (no. 050107-12.zip). It is 21 pages in all, and comprehensive by any standard, covering not only everyday use but also advanced items like URL history storage and File Encryption. The Software Guide comes as a page indexed Word document. What’s conveniently called ‘software’ here actually consists of two components: (1) PIC-resident software and (2) PC-resident software.

The PIC software is available as an .asm or .hex file. Provided you have a programmer for SOIC PICs you can burn your own device at home or at school. If not, you will have to rely on
our Readers Services by ordering a ready-programmed PIC (order code 050107-41. The PIC configuration bits, so often a source of confusion to our readers, are given in the inset. This software allows the PC to check, at 1- second intervals, for the presence of the Flash Lock dongle, or, more accurately, for the right code in the PIC’s EEPROM memory.

The PC software is a massive 20 MB of tools and an installation program supplied on a CD-ROM, order code 050107-81. Alternatively, if you’re on broadband Internet, the PC software
may also be downloaded from our website. An impression of the PC Flash Lock software in action is given by Figures 3, 4 and 5. As you can see, there are lots of options to enable you to adapt this project to your specific needs. Once installed on the PC, the resident Flash Lock utility will display a small, semi-transparent toolbar at the top of the screen. This will give access to all functions including accounts management and passwords. The software has a 10-digit ASCII password, 10-digit user name, 10-digit guest password and a 20-digit password hint. The dongle may be plugged into the COM1 or COM2 RS232 serial port on your PC and is automatically found by the software. In some cases, however, you will need to use the ‘scan ports’ option to locate the RS232 port with the dongle on it. The program provides a one-time offer to create a rescue disk and produce hard copy of essential data.

Famous last words
Finally, a word of caution: we sincerely recommend installing and using the Flash Lock device and control software on a ‘scrap’ Windows XP PC that’s not essential to serious work. By no means install the device on a PC that’s required for daily use, as even a small mistake in the PC Lock configuration will permanently bar you from access to all your files and programs! Yes, it happened to us while engineering this project towards publication. Forewarned is forearmed!

(Elektor Electronics - 10/2005)


Download this article #e05a068.pdf >>or SkyDrive link
 #050107-11.zip >>or SkyDrive link
#050107-12.zip >>or SkyDrive link

0 comments:

Subscribe to: Post Comments (Atom)