Electronic Design

  
Reprints     Printer-Friendly    Email this Article    RSS        Font Size     What's This?


[Ideas For Design]
Roll Your Own Electronic Lock

Dhananjay V. Gadre  |   ED Online ID #1154  |   February 7, 2000


Electronic security locks, popularly known as “dongles,” are commonly used to deter software piracy. This idea describes a simple yet-powerful design of such a security lock using the linear feedback shift register (LFSR) principle. The lock, which is implemented using Atmel’s AT90S2323 AVR RISC microcontroller, connects to the PC’s RS-232 serial port. The lock uses the PC’s serial port to communicate to the PC, as well as derive power for its own operation. Commercially available dongles come in various shapes and connectivity. The most common type connects to the PC’s parallel port. Increasingly, dongles with USB connectivity also are appearing, and those using RS-232 connections exist as well.

These locks use some type of programmable device containing a lock algorithm. The application software (the item to be protected) also contains an embedded version of the lock driver software. The dongle vendor usually provides the lock driver software itself. The actual lock algorithms are closely guarded secrets.

The lock design presented employs an LFSR implemented in software. An LFSR is an ordinary shift register with some of its output stages (called taps) fed back to the input. LFSRs have an interesting property that if the feedback taps are chosen carefully, then outputs cycle through 2n − 1 sequences for an n-bit LFSR. The sequence then repeats after 2n − 1 instances. If the output sequences are observed, they appear to be random.

The circuit for an 8-bit LFSR is shown in Figure 1. The LFSR is loaded with an initial “seed” value of “1” (i.e. 00000001 binary) and then the register is clocked. The resulting outputs are shown in Table 1. An 8-bit LFSR would have a cycle length of 255; similarly, a 16-bit LFSR would have a cycle length of 65,535, and so on.

The LFSR can be used in an electronic-lock implementation that would work as follows: The LFSR register is initialized with a seed value “x” and is cycled “y” number of times. The resulting register value is compared with the result that the driver calculates. If the two numbers match, it would indicate that the lock is present. Otherwise, the application software would terminate or indicate that the dongle wasn’t found. The initial seed and the cycle number can be generated by the PC using the current time of day.

Figure 2 shows the hardware for the electronic lock. An AT90S2323 processor, developed by Atmel, is used to implement the lock. The AT90S2323 is an 8-pin device and needs a supply voltage between 3 V and 6 V to operate. The power supply is derived from the RTS output signal present on the RS-232 port. Resistor R2 (1 kÙ) and zener Z1 (5.1 V) provide the supply voltage to the processor. The circuit operates using a 3.58-MHz crystal clock.

The AT90S2323 processor doesn’t have a hardware UART, so the processor software implements a serial transmit and receive function using a bit-banging method. The serial port operates at 9600 bits/s, 8 data bits, no parity, and one stop bit. The lock illustrated in Figure 2 employs an 8-bit LFSR. Higher-order LFSRs could be implemented using the taps shown in Table 2.

This lock design expects two numbers from the PC (the seed and the cycle count). It then continually calculates and sends back the result ad infinitum. The PC driver software can be written and embedded in any application that needs to be protected. Click here to view source code used for this application.


Reprints   Printer-Friendly  Email this Article  RSS    Font Size   What's This?


  • A New Design Inflection Point
  • Forecasting Industry Growth For 2009 And Beyond
  • EDA Retools To Exploit Multicore Architectures
  • Design And Verification Move Up In Abstraction
  • EDA Retools To Exploit Multicore Architectures
  • A New Design Inflection Point
  • Design And Verification Move Up In Abstraction
  • Challenges Lurk For 22-nm Physical Implementation
    1) 1-A Switching Regulators Operate With 96% Efficiency To Replace Linear Regulators
    (519 views today)
    2) Battery Pack Improves Li-Ion Management For Electric Vehicles
    (307 views today)
    3) New Power Approaches May Fuel Analog Job Opportunities In Security And Health Applications
    (298 views today)
    4) Build A Smart Battery Charger Using A Single-Transistor Circuit
    (287 views today)
    5) Step-Down Switching Regulator Provides 60-V Input Transient Protection
    (152 views today)
    ALL TOP 20



    Reader Comments

    Rating Only

    Rating Only -July 30, 2007   (Article Rating: )

    please suggest me how I will open my locker if I will forget my password

    yash -June 04, 2007

    Rating Only

    Rating Only -June 01, 2007   (Article Rating: )

    asa

    Anonymous -March 05, 2007

    respected people, i m a student of electronics engineering,i dont have much knowlege of the advanced microcontrollers,i juct know about the 8051,8052,only...i want nto know about the electronics lock build by AT90S2313 AVR RISC controller,.........please tell me the source of archietecture & technical depths,it just have only 8 lines? how can we use it.please mail me please mail me at er_rahulkapoor@yahoo.co.in or at ur_end@sify.com

    rahul kapoor -July 26, 2006   (Article Rating: )

    hey i have to make electronic door lock using 8051 microcontroller. can anyone help me out or try to show me its circuit diagram and interfacing of the microcontroller with the motor?

    vabs -June 29, 2006

    hey i have to make electronic door lock using microcontroller. can anyone help me out or try to show me its circuit diagram and interfacing of microcontroller with door and motor for opening door

    Anonymous -June 26, 2006

    Silver/Gold Keyless Electronic Digital Door Lock YL88

    Discount Tommy is pleased to be carry the Taft YL88 keyless lock. The patented design is one of a kind and is designed to last a lifetime. Again, Premium Locks has looked long and far to bring you the most advanced, robust, and full featured digital lock at a discount price. If you are considering a keyless electronic lock, look no further. We are confident you will be satisfied with the ease of installation and quality of this lock.

    This is a new Taft keyless lock. It is a stand alone electronic pushbutton lock that retails for $129. You can change the access codes any time, right on the keypad of the lock. It Installs easily in a standard 2 -2 1/8 inch diameter hole. This lock can retrofit almost all cylindrical locksets. FEATURES:

    This lock is capable to have total 10 passwords that include 1 master code and 9 user codes. Any user codes and master code can unlock the lock—you can set or change these codes at anytime to suit your needs. The master code can be any number combination of 0 through 9 with maximum of 15 digits. The user code can be any number combination of 0 through 9 with maximum of 15 digits. NOTE: They must start with 1 to 9,since the master code always starts with 0. Single user codes are changeable

    You can use the emergency module if the battery completely runs down.

    When the door closes the lock will lock. The inside lever is always free to turn and open the door.

    All user codes can be deleted in one easy operation

    Entry access using just the "ON" button by MasterCode

    Entry Access using just the "ON" button set by Authorized User Code

    Battery back up module in case of emergency.

    New generation patented design. Uses 4AAA batteries.

    Heavy-duty trim design.

    Visual and audible entry LED indicators.

    WHAT IS INCLUDED?

    YL88 Digital Lock

    Adjustable Latch.

    User manual

    Installation Hardware

    Emergency Battery Back-up Module

    TAFT.Zhu -June 02, 2006   (Article Rating: )

    We are a manufacturer and exporter of Specializes in high quality locks, electronic lock, cabinet lock, door holder, door closer, door lock, IC card lock, drawer lock, luggage lock, fingerprint lock, lever lock, inductive lock, knob lock, door viewer, vehicle lock, sliding door lock, bicycle lock, pad lock, motorcycle lock, coded lock in Shanghai China and established in 1998, we are looking for agent or distributor, if you are interesting to our products, then, please advise us, welcome visit our Web Site http://www.electronic-lock.com, New design of electronic style for OEM are welcome, we can also design and making any locks for clients.www.electronic-lock.com

    Anonymous -May 23, 2006

    ShangHai Taft Electronic lock Co.,Ltd Contact Person: Mr. Taft Zhu (Accounting) Company: ShangHai Taft Electronic lock Co.,Ltd Address: Caoyang Road Lane 2155 Room 301, Shanghai, China, China Zip/Postal: 086 Telephone: 86-021-52759183 Fax: 86-021-52759185838

    Anonymous -May 09, 2006

    hi! i got the project to construct.. dongle using ATmega16.. can anyone help...?? FIONA??

    kush -December 20, 2005

    Hi, I am a Logistics person & I want to know the exact HS code for Importing this item.

    christy denzil -December 02, 2005

    This is sort of interesting, but LFSR's are not cryptographically secure and their operation can be fairly easily predicted from a few sample inputs/outputs.

    why is this any better than just a plain-old password?

    Ornery Sixstep -November 23, 2005

    i m a student and want to make electronic locker with help of 8051 microcontroller, dc motor.can u tell me something about this

    amit lohach -November 18, 2005

    good!i m a student and want to make electronic locker with help of 8051 microcontroller.can u tell me something about this

    rachit ahuja b.tech iv year(ec) 09412660236

    rachit -October 19, 2005

    Hi. I'm doing a project that requires to develop an electronic security dongle using ATmega microcontroller, interfacing the parallel port of PC. I would like to know what are the lock algorithms available and how I can do the programing for the electronic lock and build its corresponding hardware circuit.Thanks.

    Fiona -August 07, 2005   (Article Rating: )

    I'm a student from NJ and I have to do a project for my class. I need information on how the eletronic locks work. Thanks.

    Luisa Fernada Toro Quintero -February 27, 2005

    I want to know how I can do the programing for the electronic lock.

    Clement -February 10, 2005

    I just want to know all about electronic locks, and their application. Also, those that can be used for doors, etc.

    Dotun -November 08, 2004

    This has been an extremely important design idea I have ever read!! Thanks for publishing it in your magazine.

    But it has several errors in both hardware and software that make it doesn't work. The circuit doesn't work because it doesn't convert TTL output to RS-232 level. The author might forgot to put some instructions in his source code or it might be misprinted.

    I have made corrections on both soft and hardware and developed several working projects from it, including an AVR HyperTerm Programmer which connects to COM1 and using the HyperTerminal program within any Win32 PCs.

    The funny aspect is the programmer doesn't need power supply! it just steals the COM lines power. I have never seen this happened.

    Thanks very much to Ms. Lucinda Mattera who helped me to get that source code. Thanks. If anyone wants to have the Programmer, please contact me at gyxu@cmpmail.com

    G.Y. Xu, Electrical Designer

    G.Y. Xu -March 23, 2004

    POST YOUR COMMENTS HERE
    Name:

    Email:
    Your Comments:

    Enter the text from the image below


    Please refresh the page if you have trouble reading this text.

    Search Electronic Design
         
      
     
    Web Seminar
    Sponsored By:
    Title: Read Pacing: A Performance Enhancing Feature of PCI Express Gen 2 Switch Devices
    Speakers: 
    Date: 07/01/08
    Register: 

    Electronic Design Europe Electronic Design China EEPN Power Electronics Auto Electronics Microwaves & RF
    Mobile Dev & Design Schematics Find Power Products Military Electronics EE Events Related Resources