Anyone done a rolling code key-lock?

Discussion in 'General Electronics Chat' started by THE_RB, Apr 23, 2013.

  1. THE_RB

    Thread Starter AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    Hi, I'm thinking of making a electronic key and lock, where the communication is one way only, ie; from key to lock. Probably InfraRed.

    It is important the system cannot be broken by snooping. For instance if someone records a previous successful communication, and replays it, it will not open the lock a second time.

    There are a number of ways this can be done with "rolling codes" where the code changes (increments) each time it is used, and previous codes become invalid.

    One of the complications is that it would be nice to have more than 1 key device, ie for two different users. So the rolling code incrementation must not cause conflicts between multiple users.

    If anyone has done a simple rolling code type implementation I would love to hear from you re how it worked, or potential issues etc. :)
     
  2. crutschow

    Expert

    Mar 14, 2008
    12,991
    3,227
    In case you haven't seen it, here's a paper on using rolling codes which can use multiple transmitters. Sounds like an interesting project. :)
     
  3. WBahn

    Moderator

    Mar 31, 2012
    17,716
    4,788
    I think that, normally, multitransmitter systems simply maintain a separate state variable for each transmitter. However, they usually do this by comparing the received code against all state variables they are maintaining and activate if any of them match (since they don't know which transmitter is talking to them). Thus, if you have four transmitters, you have made it four times as easy for the bad guy to hit a valid code.

    Also, my understanding is that most of the rolling code stuff out there doesn't use a long enough sequence or use sufficiently simple sequence generators that, given today's computing power, it is pretty easy to record a few sessions and then construct the sequence parameters to predict the next code. So be sure to consider that.
     
  4. GopherT

    AAC Fanatic!

    Nov 23, 2012
    5,991
    3,737
    Here is an application note from National.

    here

    Chip is from 1996 but the information of how the process works is good. The chip is able to do 2^48 codes across four devices in IR or RF.

    I have a hand full of the chips from a collection of junk I once purchased. I have never found the need in any project so far but you never know. Send me a PM if you want to test a pair and give me feedback how they work.
     
  5. THE_RB

    Thread Starter AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    Thanks guys! :)

    Crutschow; I will read through that Atmel PDF, thanks for that.

    WBahn; Yep I knew that many rolling codes are low security, that won't be an issue for me as I plan to use massive (matching) random keys inside the key and lock. So the rolling code is hashed with these massive keys, it will be virtually unbreakable as interception of a 64bit code (or many 64 bit codes) still can't lead to reverse deciphering an 8000 bit key.

    Re the multiple users (multi key) what I had imagined is that the rolling code just contains an extra couple of bits to identify which user. That should not reduce security as it doesn't give a hacker more times the data (or less permutations).

    GopherT; Thanks but I'm not really interested in dedicated chips, but more interested in general code or algorithm implementations. :)
    I'd still like to hear specific suggestions, especially from
    someone who has done a key->lock data application. :)
     
Loading...