Cipher type EC/CBC

Everything else that doesn't fall into one of the other PB categories.
Baldrick
Addict
Addict
Posts: 860
Joined: Fri Jul 02, 2004 6:49 pm
Location: Australia

Cipher type EC/CBC

Post by Baldrick »

I am looking at writing up some code to operate as a small localized receiver for an ethernet based alarm module. It runs in both plain text mode & encrypted modes. The data is sent in a csv format, so in plain text it has taken me about an hour to get data both readable and transmittable, so easy enough for me to sort that side hopefully.
The system also has an option to send & receive data using what it calls EC/CBC cipher.
I have never heard of this encryption & am wondering if anybody here could point in the right direction to get information on what this EC/CBC stuff is?
User avatar
Kuron
Addict
Addict
Posts: 1626
Joined: Sat Oct 17, 2009 10:51 pm
Location: Pacific Northwest

Re: Cipher type EC/CBC

Post by Kuron »

Baldrick wrote:I am looking at writing up some code to operate as a small localized receiver for an ethernet based alarm module. It runs in both plain text mode & encrypted modes. The data is sent in a csv format, so in plain text it has taken me about an hour to get data both readable and transmittable, so easy enough for me to sort that side hopefully.
The system also has an option to send & receive data using what it calls EC/CBC cipher.
I have never heard of this encryption & am wondering if anybody here could point in the right direction to get information on what this EC/CBC stuff is?
EC=Elliptic Curve algorithm (could also mean: Electronic Commerce)
CBC=Cipher Block Chaining
Best wishes to the PB community. Thank you for the memories. ♥️
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8453
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: Cipher type EC/CBC

Post by netmaestro »

That'll be AES, EC in this case stands for "Electronic Codebook". See Purebasic AESEncoder docs for a bit more info.
BERESHEIT
Baldrick
Addict
Addict
Posts: 860
Joined: Fri Jul 02, 2004 6:49 pm
Location: Australia

Re: Cipher type EC/CBC

Post by Baldrick »

@Kuron, We have come to the same conclusion. Is it codebook or eliptic curve, who knows, the sales people I have tried to speak with just cringe & runaway & hide with questions like that.... :D

@Netmaestro, That looks like it might give me an excellent place to start & being that I can change these units between plain text & encrypted modes quite easily means I am confidant I will be able to work this out with simple trial & error until I get it right. :)
From what I have seen so far it seems to be using a 4 digit hex key which means it is using a 16 bit key. So, from the PB docs you have pointed me at, I can assume I am dealing with 128 bit encryption now, so that is what I will work with.
Think I will get it all running smoothly in plain text mode 1st, then come back to this part later...
User avatar
idle
Always Here
Always Here
Posts: 6238
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Cipher type EC/CBC

Post by idle »

it should read ecb or cbc

ecb = electronic code book
cbc = cipher block chaining

chances are it will probably be AES but it may be others like blowfish

ecb is like a static encryption mode that uses the same cipher on each block
cbc modifies the cipher block based on the last encrypted block (more secure and a little slower)

it's won't be elliptic curve.
Windows 11, Manjaro, Raspberry Pi OS
Image
Baldrick
Addict
Addict
Posts: 860
Joined: Fri Jul 02, 2004 6:49 pm
Location: Australia

Re: Cipher type EC/CBC

Post by Baldrick »

Thanks Idle.
I havent looked at it at all today, but if I can get around to it, I might see what I can do to get it running in plain text mode over the next few days which from what I have looked at with them so far I think should be pretty straight forward.
Once I am happy with that I will make up a bit of an emulator for the uC and see what I can sniff out.
(These things are actually 1 your NZ products. The biggest problem at the moment is the Aus distributor has basically gone belly up from what I can gather, so getting hold of these units is a bit of a challenge ATM, let alone getting any technical questions answered. But no matter, I will hack my way through it 1 way or another.....)
The biggest issue is the setup software they are supplying is really, really, welllll... Ordinary, buggy, etc, which is a pity as these things have so much potential.
So apart from making my own setup software, I am thinking of writing my own mini receiver application which I can supply to small industries, etc to allow them to monitor stuff for limited times as they choose from their admin offices, etc which I would limit this to just a few systems per receiver. :)
This is the Uc - http://www.micronsecurity.com/news.php?id=18
User avatar
idle
Always Here
Always Here
Posts: 6238
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Cipher type EC/CBC

Post by idle »

You could try to flick them an email at their info address or get on the blower to them.
It does seem a bit odd to mention encryption modes without saying what it is.
Windows 11, Manjaro, Raspberry Pi OS
Image
Baldrick
Addict
Addict
Posts: 860
Joined: Fri Jul 02, 2004 6:49 pm
Location: Australia

Re: Cipher type EC/CBC

Post by Baldrick »

I have spoken with them Idle & all they want to do is refer me to the 'new temporary Australian distributor'.
The new Au distributor is a software developer in Brisbane & I have known the owner (by telephone at least) for years. Speaking with him, he freely admits that he knows very little about the units & is just keeping a supply line open until they find a more permanent solution.
Also, with the NZ, I have had awful trouble just trying to understand the guy they have as tech support due to his really thick non english accent.

Edit: I do also have full technical access via their website and apart from saying it is using this EC/CBC encryption it contains nothing in the way of detail about what it actually is......
User avatar
idle
Always Here
Always Here
Posts: 6238
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Cipher type EC/CBC

Post by idle »

I suppose you'll just have to try to decrypt the data!
Windows 11, Manjaro, Raspberry Pi OS
Image
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8453
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: Cipher type EC/CBC

Post by netmaestro »

Do you have the key / init vector? If not, there will be no decoding it..
BERESHEIT
Baldrick
Addict
Addict
Posts: 860
Joined: Fri Jul 02, 2004 6:49 pm
Location: Australia

Re: Cipher type EC/CBC

Post by Baldrick »

Netmaestro, I have a receiver here which will show me all the keys, data, etc, in real time so I think it is worth having a stab at it.
I know exactly what the csv data looks like now, so that combined with the receiver showing me the decrypted keys along with what looks like a raw data string will give a me place to start from.
Definitely will be an interesting challenge. :)
Baldrick
Addict
Addict
Posts: 860
Joined: Fri Jul 02, 2004 6:49 pm
Location: Australia

Re: Cipher type EC/CBC

Post by Baldrick »

Little update:
I did write up a nice simple little test server for this unit, but haven't bothered attempting the encryption. Good thing I think as I have just been sent a unit from a company which is manufactured in Hungary to do some testing. This new unit quite simply chews up & spits out the other companies product. Even better is that they are open about the cipher they use which is 128 bit AES & allows me to set my IV. Don't know what they are going to cost yet, but I do believe I have an excellent answer now in my product search. :)
Post Reply