Pages: [1]   Go Down
Author Topic: Alarm system and radio transmission  (Read 1296 times)
0 Members and 1 Guest are viewing this topic.
Germany
Offline Offline
Full Member
***
Karma: 1
Posts: 221
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

for my alarm system, I am planning to
- use a PIR
- use a reed switch (NO=normallyopened,and used with pulll up)
- send signal to base station

Base station evaluates the signal then

As a matter of security, and that is the important thing for me of course, I need to know how secure the following technique/idea is:
- sending a "OK"-signal all 3 secs (not with delay, but see Arduino - BlinkWithoutDelay) that is encrypted with a rolling code (e.g. keeloq)
- if any kind of alarm happens (PIR gets high OR reed gets switched) then send a "ALARM"-signal and stop sending the "OK"-signal (actually not necessary, but I think it is better anyway)
- base station wants to get a "OK"-signal all 5 secs (even if it is sent all 3secs, maybe some dont reach the recv) and decrypting it -> check ok
- if not received a "ok" signal  OR received a "alarm"signal -> Alarm! by switching a relay with a siren

What do you think is this secure and do you have any impreovement?
Thank you
Logged

using Arduino Uno Rev 3

Offline Offline
Newbie
*
Karma: 1
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Secure in what sense? From people hacking the wireless link? What if people just bypass your sensors with a wire?
Logged

Germany
Offline Offline
Full Member
***
Karma: 1
Posts: 221
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Secure in what sense?
At all, that's why I tried to describe the situation.

From people hacking the wireless link?
for example

What if people just bypass your sensors with a wire?
I forgot to mention the system is inside the building. However you could, if you know exactly where everything is placed, work carefully and bypass with a wire.
Logged

using Arduino Uno Rev 3

Grand Rapids, MI, USA
Offline Offline
Sr. Member
****
Karma: 10
Posts: 282
Yes, I remember
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Who are we trying to keep out?  I can tell you none of the thieves and home invaders in our neighborhood would be able to hack the wireless link even if it was non-coded, unencrypted, and I posted the instructions on the front door!  They might try to cut a wire, so you should make sure that would set off the alarm.  As with adding a wire to bypass a sensor I would again consider this beyond their level of expertise.

On the other hand if you are trying to keep out foreign spies or electrical engineers you are going to need all the help you can get.
Logged

Corinth, TX
Offline Offline
Jr. Member
**
Karma: 1
Posts: 92
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm a security guy by trade and although my specialty isn't physical security (I am currently sharpening those skills with a side project), defending against those who would defeat encryption is right up my alley.  I see an immediate problem with what you described.  Encryption is only viable if one cannot easily determine a pattern.  I don't need to know your key if you send the same encrypted message repeatedly.  This is especially bad when that repeated message is an "OK" message.  If I wanted to defeat this wireless alarm sensor, I'd monitor the normal condition and try to figure out the rolling code, which honestly shouldn't be that hard.  I could probably even build an arduino based device to drop in some hidden place on your premises somewhere and figure it out for me smiley

Wireless security is a very tough endeavor.  You're putting messages out into the world for anyone who is listening.  There's no way for you to know if/when someone actually is listening, so they have all the time in the world to figure out your encryption mechanism.  Your goal in something like this is to make it take them so long that they become disinterested, their listening device/method is discovered, or they move on to an attack method that gets them caught.  For the determined and clever thief, that will probably not happen before they compromise the system.  This category of attacker is your worst enemy when it comes to wireless security... but they are few and far between.  The fact that you're considering wireless in the first place means that you are probably not a target for those folks.  Never say never, of course.

Ultimately, it comes down to how much risk you're willing to accept and how much time and money you're willing to spend to overcome the unacceptable.  IMHO, moving to a wired solution has some entry cost but in the long run will save you money and, perhaps more importantly, time.  While it's certainly possible to defeat even the best wired system, it does present a hurdle that will discourage many would-be attackers.  For those reasons, I absolutely recommend moving to a wired solution.

That's off my chest, so I can speak to your actual question a bit smiley.  Again, this is not a recommendation... but if you simply must use wireless then try to incorporate another factor besides the rolling key.  Add something to your message that makes it harder to identify a pattern.  A good example solution to this problem is to pad your messages with a pre-shared long list of unique phrases.  Another version of that concept would be to use a long list of unique messages that all mean ok or fault.  Throw in some nonsense (although *not* random) messages at irregular intervals that are ignored by the receiving end.  randomize the interval at which valid messages are sent (while keeping it within your expected max length between OK status messages).  encrypt each of those with your rolling key.  If you do all of those things, identifying a pattern and imitating it will be very difficult.  If you really want to get crazy you can do all sorts of things to further increase that difficulty.  Just remember to stay away from published standards and methods. 

I know that sounds like a lot, and it's still nowhere near what I would consider highly secure... but it should get you started down the path of really hardening your system.  Take away an attacker's ability to use the "1337 hax0r" crap they can download off the internet like any other idiot and you will eliminate 99% of your threats.  Then you just have to stall, confuse, and discourage the other 1% long enough to catch them smiley

Logged

New Jersey
Offline Offline
Faraday Member
**
Karma: 72
Posts: 3763
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Just remember to stay away from published standards and methods.

If you're really serious about security, this should not apply to the encryption algorithm you use - you need something devised by a cryptographer and peer reviewed. It is a common conceit to suppose that you can devise your own secure encryption method, but it is highly unlikely that you can.
Logged

UK
Offline Offline
Shannon Member
****
Karma: 223
Posts: 12630
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Some ideas we've used to encrypt data within software that could carry over to your DIY wireless security scheme:

Encrypt your application messages, chop the encrypted messages and shuffle the parts among multiple wireless packets (which are then sorted and reassembled by the receiver).

Rotate your encryption keys at regular and fairly small intervals.

Include a predictable unique value in all messages, such as a recent challenge, or a timestamp.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Germany
Offline Offline
Full Member
***
Karma: 1
Posts: 221
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

thank you very much for your answers!
@jroorda: This is an important question to ask. I think other factors should be regarded more than the encrypted wireless transmission that might be an overkill, as I understood the answers like. It has to be reliable always.
Maybe the thief is able to jam the transmission frequency, because he thinks that will avoid the base station getting  the "alarm"-signal, but in fact he just prevents my "OK"-signal to reach the base station and that will result Alarm before even getting in. This is also a problem because this is a false-positive, the alarm can be triggered without making physical damage. Do you think this is a problem for the system?
@djjoshuad:  I read your long answer with interest and I think I will concentrate of those 99% of burglars that are not electronically skilled. However, I think it is not able to get the key behind the rolling technique, Rolling code - Wikipedia, the free encyclopedia, RKE Analysis, a replay attack will fail because the "OK"-signal always changes.
@wildbill,PeterH: I am still not sure whether I should add encryption to the system or not, it also makes the system more fragile because it is not simply get-ok-signal or not get it, but also checking whether the decrypted counter is in a specific allowed range.
For me the wired solution would be a sophisticated one because the alarm station and the base station are in different floors and cable laying doesnt look that nice and is difficult to hide.
I am not only interested in the factor of wireless signal but also others like the alarm device (siren, strobe,...) For that I am planning to do the following:

If the cable is cut, the lightblue cable is also cut and that is recognized by the Arduino, but how to trigger the alarm then if you know you cannot trigger it?!
Logged

using Arduino Uno Rev 3

Corinth, TX
Offline Offline
Jr. Member
**
Karma: 1
Posts: 92
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Just remember to stay away from published standards and methods.

If you're really serious about security, this should not apply to the encryption algorithm you use - you need something devised by a cryptographer and peer reviewed. It is a common conceit to suppose that you can devise your own secure encryption method, but it is highly unlikely that you can.
This is patently untrue.  This is just like telling us that all of our electronic circuits should be devised by electricians and our sketches should be devised by programmers.  Of /course/ people can devise their own encryption methods.  The only thing a "cryptographer" is going to do better is avoid the common pitfalls.  Is the resulting algorithm going to be as good as one coming from a seasoned pro? no... but it will be unique and unique beats good quite often in the security world.

If you're really serious about security, then reducing your attack surface should be a primary concern.  Avoiding standards reduces it immensely.

@karlok - a rolling code can be defeated fairly easily once you recognize that it is being used.  A replay attack just replays the last message and would of course fail.  Actually determining the rolling key algorithm will allow you to modify the next message and "play" it with the right key.
« Last Edit: January 05, 2013, 03:26:14 pm by djjoshuad » Logged

Germany
Offline Offline
Full Member
***
Karma: 1
Posts: 221
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@karlok - a rolling code can be defeated fairly easily once you recognize that it is being used.  A replay attack just replays the last message and would of course fail.  Actually determining the rolling key algorithm will allow you to modify the next message and "play" it with the right key.
Hello, I still am not able to beleive that. How would you do so. For me a rolling code is an always changing code that is created by using a secret key and a message(message = counter in this case).

And I am also interested in the outdoor cable idea where I drew the picture.
Logged

using Arduino Uno Rev 3

Corinth, TX
Offline Offline
Jr. Member
**
Karma: 1
Posts: 92
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@karlok - a rolling code can be defeated fairly easily once you recognize that it is being used.  A replay attack just replays the last message and would of course fail.  Actually determining the rolling key algorithm will allow you to modify the next message and "play" it with the right key.
Hello, I still am not able to beleive that. How would you do so. For me a rolling code is an always changing code that is created by using a secret key and a message(message = counter in this case).

And I am also interested in the outdoor cable idea where I drew the picture.
There isn't a /lot/ of information here, but go read http://en.wikipedia.org/wiki/KeeLoq - specifically the parts about the weaknesses.  This is not to say that it doesn't provide a good encryption mechanism, but it is certainly breakable and really not that difficult.  Without going into a full on crypto lesson, it suffices to say that any mechanism can be broken given enough time and a little luck.  An attacker needs far less luck when you use a standard mechanism.  If you are doing something very proprietary, there are no off-the-shelf tools available to break your code... so it takes far more intelligence and a lot more luck.

It makes me happy that you are considering using a wired solution.  That reduces your risk significantly, not to mention making power, range, and a whole host of other hurdles much easier to deal with.  It just takes a bit more work to implement smiley
Logged

Germany
Offline Offline
Full Member
***
Karma: 1
Posts: 221
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What do you think about the idea (http://arduino.cc/forum/index.php/topic,140776.msg1058205.html#msg1058205) to control whether the cable to the siren was cut? Can this method work - the idea is that there is a short circuit from Arduino GND to a pullupped Arduino Digital In, if the cable is cut anywhere - this is like a switch - it will be recognized. How to make the alarm then?
Logged

using Arduino Uno Rev 3

Pages: [1]   Go Up
Jump to: