Page 1 of 2

keeloq algorithm and pic microcontroller

PostPosted: Thu Oct 09, 2014 7:14 am
by phoenix2000
hello every body
I want to build a secure 2 way remote control.so i decided to use the encoder and decoder of microchip :HCS family
my question is ,can i use any kind of pic micro controller(without any decoder) in order to decode the hopping code in receiver?
at first i thought that it's impossible because we don't know the keeloq algorithm,to decode the receive code.but reading AN662 put me in doubt.

Re: keeloq algorithm and pic microcontroller

PostPosted: Thu Oct 09, 2014 3:27 pm
by phoenix2000
nobody knows ???

Re: keeloq algorithm and pic microcontroller

PostPosted: Fri Oct 10, 2014 2:58 am
by AussieSusan
You expect a response in under 8 hours?
Susan

Re: keeloq algorithm and pic microcontroller

PostPosted: Fri Oct 10, 2014 5:43 am
by Joseph Watson
After looking AN662 over, I think that the implication is that it is possible to implement the KEELOQ® decoder algorithm on many PIC microcontrollers but that there is important information needed about the details of the decryption algorithm that are not disclosed in AN662. They are, however, disclosed in AN652. Once you have the details of the algorithm, it looks like you can implement the decoder yourself but to get the details of the algorithm, you will need to enter into a non-disclosure agreement with Microchip.

Near the bottom of the first page of AN662, it says, "Notice: This is a non-restricted version of Application Note AN652 which is available under the KEELOQ License Agreement. The license agreement can be ordered from the Microchip Literature Center as DS40149."

On page 11, it says, "The confidential and proprietary information contained in this section of AN652 has been removed. The full application note is available under a license agreement and can be ordered as DS40149 from Microchip Technology Inc."

That license agreement will doubtless place you under certain limitations on what you can legally do with the algorithm information. You could try ordering the license agreement to see what it says.

About 35 years ago, when remote locks were first available for cars, a remote transmitter always transmitted the same code when a button was pressed. That made it possible for a crook to build a code grabber that could be used to capture the code when someone locked their car and walked into a store. Later, the crook could transmit the open door command using the captured code and break into the person's car. That is why systems like KEELOQ® were created. They transmit a different code each time the button is pressed. In general, the receiver rejects a code that was previously received, thus preventing the use of such code grabbers. The encryption scheme is used to provide subsequent valid codes that the decoder will be able to recognize and decipher. Good luck with your project.

Re: keeloq algorithm and pic microcontroller

PostPosted: Fri Oct 10, 2014 8:17 am
by phoenix2000
thanks dear Joseph. ;)
best regards for you ;)

Re: keeloq algorithm and pic microcontroller

PostPosted: Fri Oct 10, 2014 10:41 pm
by tunelabguy
Many years ago when I was very interested in cryptography, I applied for and got the full details of the algorithm after signing the non-disclosure agreement. It is not very difficult to program if you wanted to do it yourself in a PIC, but if you use it in an application, you would have the responsibility of ensuring that your software containing the algorithm is not made available to anyone else. That means if you put that code in a PIC, you must ensure that PIC is copy-protected. Frankly, I don't think the algorithm is anything special. It is not very efficient in terms of execution time. That is where it gets its security - overkill. But since the intended applications do not process lots of data or run the algorithm frequently, this overkill does not really hurt. Anyone skilled in the basics of cryptography could design an algorithm that is equally secure. Then you would not have to worry about agreements with Microchip. Just roll your own on both sides of the comm link.

Re: keeloq algorithm and pic microcontroller

PostPosted: Mon Oct 13, 2014 8:11 am
by user2009
I dont think its relevant for your applicationn but a couple of month ago I talked to some security researches who broke the security of keeloq devices using side channel attacks [1].

[1] http://www.emsec.rub.de/keeloq

Re: keeloq algorithm and pic microcontroller

PostPosted: Thu Oct 16, 2014 11:50 am
by phoenix2000
tunelabguy wrote:. Anyone skilled in the basics of cryptography could design an algorithm that is equally secure. Then you would not have to worry about agreements with Microchip. Just roll your own on both sides of the comm link.

thanks for your information ;)
can you please guide me to proper reference , i need to work on cryptography exactly in order to replace a secure algorithm for microchip keeloq encoder/decoder like hcs301/hcs500.
but unfortunatly i know nothing about cryptograghy
Image
so i would appreciate you help me
thanks again for your helpImage

Re: keeloq algorithm and pic microcontroller

PostPosted: Thu Oct 16, 2014 1:54 pm
by tunelabguy
Bruce Schneier's book, "Applied Cryptography" is a good start. Then look at the paper referenced by user2009 in the previous posting, specifically, the reference called "Messing around with garage doors". That paper actually shows the Keeloq algorithm structure, except for the details of the non-linear feedback function, which you don't need unless you are trying to exactly duplicate Keeloq. That will give you an idea of what sort of cryptographic algorithm is well-suited to the limited RAM of these small PICs. Just substitute your own non-linear function using a random lookup table.

Re: keeloq algorithm and pic microcontroller

PostPosted: Fri Oct 17, 2014 5:10 am
by phoenix2000
thanks dear tunelabguy and dear user2009Image