|
|
|
|
|
|
BMW Garage | BMW Meets | Register | Today's Posts | Search |
|
BMW 3-Series (E90 E92) Forum
>
I cloned my MSV70 DME
|
|
12-21-2016, 03:23 PM | #1189 | |
Captain
253
Rep 775
Posts |
Quote:
1) DME computes the hash (I think MD5, might be SHA1) of the target ranges, and pads the data. Like a CRC, the hash can be done fairly rapidly by just loading x # of bytes at a time. Unlike a CRC, finding a hash collision is very difficult 2) The DME decrypts the RSA signature using the public key (which is a large composite number [the modulus] a long with a relatively prime exponent). If the results of 1 and 2 match, the signature is validated. The signature is generated by encrypting the padded hash with the private key (a properly designed private key is a product of two large prime numbers). Public modulus is the two prime numbers multiplied together. Current record for factoring an RSA-like number is 768-bits with a gigantic computing cluster. So the 1024-bit keys in these DMEs are probably uncrackable for another 10 years. 2048 and 4096 bit keys found in newer DMEs are going to remain impossible for quite some time unless quantum computers become a thing. 512-bit is doable in about 1-2 weeks with a modern quad core i7. Or about an hour on an Amazon EC-2 cluster. So MS45 is doable if I could figure out the hashing algorithm and the exponent BMW used. Capturing the hash might help figure out the hash and pad algorithm, which would be useful on a DME where the key is small enough to be cracked. But it's pretty useless for the MS*70. |
|
Appreciate
0
|
12-21-2016, 06:04 PM | #1190 |
Colonel
1002
Rep 2,287
Posts |
RSA Delete that I have been using is the following
0x030580 2C 0C 00 FF Replace with 0x030580 7C 0C 60 00 and 0x0300D9 2C 0C 00 FF Replace with 0X0300D9 7C 0C 60 FF Of course checksums as well. I think it will work with just the 0X0300D9 change but I have not bothered to try. |
Appreciate
0
|
12-21-2016, 08:41 PM | #1192 | ||
Colonel
1002
Rep 2,287
Posts |
Quote:
I did not think we could capture the private key, just the RSA of a single specific program. All we need is the validated signature for a program with RSA delete for the calibration file. Just brainstorming.... |
||
Appreciate
0
|
12-22-2016, 12:20 AM | #1194 | |
Captain
253
Rep 775
Posts |
Quote:
With that said, Kess V2 *is* able to correct the RSA signature right? That means it must have the private key. If we can recover that (along with the hashing algorithm), then we can sign anything. |
|
Appreciate
0
|
12-22-2016, 09:23 AM | #1195 |
Major General
3987
Rep 7,212
Posts |
I don't think so. I had to do an RSA delete for somebody who was trying to flash a modified program with a real Kess V2 because it failed the signature check over OBD. Alientech customer support told them they couldn't flash outside the parameter space. I doubt BMW used a different key for the program and parameter space, so they are doing something else for the parameter signature. Maybe something like the Galletto, or the OFT, or any of the handheld tuners that are resold by places like AA.
If they do have a private key, then BMW uses a different one for the program/parameter spaces. But in the boot sector there's only one public key right? |
Appreciate
0
|
12-22-2016, 10:28 AM | #1196 | |
Captain
253
Rep 775
Posts |
Quote:
It's possible Kess doesn't actually correct the program RSA because they didn't bother coding that in. But if it's able to correct the parameter RSA signature, then it must have the private key (or at least something along the lines of the "fakesigning" bug that was present on the Nintendo Wii) |
|
Appreciate
0
|
12-22-2016, 12:42 PM | #1197 |
Major General
3987
Rep 7,212
Posts |
Yeah I'm not sure. I'd have to see a readout of a DME flashed with Kess. If the boot sector is not modified then they must have a key of some sort. The RSA checks are separate for the program/parameter space it could be they only modified the parameter space routine.
|
Appreciate
0
|
12-23-2016, 04:47 PM | #1198 |
Colonel
1002
Rep 2,287
Posts |
Ok for the record, after I separate pin7 and pin8 on my cable and change both winfkp trace levels to 0, I can flash a full custom calibration file into the car within 35 seconds.
That's the time between pushing the program button until I get the program ok flash screen. Hell, it take four times as long over BDM and I don't need to pull the DME. The BIN to ODA Converter program I have seems to be running really well, it's crude but it works. |
Appreciate
0
|
12-23-2016, 05:19 PM | #1199 |
New Member
0
Rep 28
Posts
Drives: BMW 130i Manual
Join Date: Dec 2016
Location: NZ
|
I take it changing the winkfp trace and api levels has no effect unless you want to debug?
|
Appreciate
0
|
12-23-2016, 05:26 PM | #1200 |
Colonel
1002
Rep 2,287
Posts |
|
Appreciate
0
|
12-24-2016, 10:37 AM | #1201 | |
New Member
0
Rep 21
Posts |
Good day
MILANSTEUERUNG I to wert_02, and it after coding all the same remains to wert_01. https://imgdepo.com/show/9618988 Quote:
|
|
Appreciate
0
|
12-24-2016, 11:25 AM | #1202 |
Major General
3987
Rep 7,212
Posts |
Yeah i dont think you can change coding after the hour/km limit (i think its 10 hours /1000km or something). They are permanently locked. You have to flash it.
|
Appreciate
0
|
12-24-2016, 12:09 PM | #1205 | |
Colonel
1002
Rep 2,287
Posts |
Quote:
All the information required is written right here in this single post! It's a long read but there is no better source if information on this subject. Maybe someone will create a new clean post with only informative details but I would not hold your breath. |
|
Appreciate
0
|
12-24-2016, 05:31 PM | #1208 | |
Captain
253
Rep 775
Posts |
Quote:
Could also be one of those things that the DME has no problems writing, but EDIABAS doesn't unless timer is 0. Last edited by Terraphantm; 12-24-2016 at 05:55 PM.. |
|
Appreciate
0
|
12-24-2016, 08:52 PM | #1209 |
Captain
253
Rep 775
Posts |
Well, I managed to change the "VMAXCODIERUNG" and "OLULCODIERUNG" on my DME.
This is the section of code that's relevant for the PowerClass config (there are other nearly identical checks for vmax, cat converter, MIL, etc). Now in my case I have those AIF RSA delete bytes set, so my DME was receptive to changing the powerclass, etc. But you can just write a modified 0PA with those branches modified. Coding with NCSExpert on the other hand is actually not as simple as it seems. FSW_PSW coding doesn't work; you have to do nettodata coding, and even then you can only edit a single parameter at a time. Easiest way: 1) Load NCS Expert, read 6BMOT. 2) Load NCS Dummy, open the correct daten file (MSV70.C04 for me), and load your NETTODAT.TRC file 3) Check the boxes for the value you want to edit. In the example below, I'm changing OLULCODIERUNG to wert_02 4) Expert the Nettodata file (I just saved it as NETTODAT.MAN) 5) Back in NCS Expert, click on "Basic Functions" (F5) 6) Select coapiCodeSgByNettoData and hit Okay 7) Under Nettodatenliste, enter the file name of your nettodata file (nettodat.man in my case) 8) Hit okay Wait a couple seconds and it should be done. Read back your FSW_PSW, and you should see the new setting take effect. |
Appreciate
0
|
12-24-2016, 10:33 PM | #1210 |
Major General
3987
Rep 7,212
Posts |
Interesting - i remember making comments on those trt comparison branches,i dont think i had made the connection since figuring out the RSA bytes.
But either way, you have to flash it to change those bytes, so why not just change the parameters instead of all the work in ncs expert? |
Appreciate
0
|
Bookmarks |
|
|