The algo fills the bytes in a "natural" way (left to right, ha-ha) and then has the bytes shuffled in a way that will match the actual checking sequence in CEM in order to have the best latency overhead for the good PIN subsequence.
https://github.com/vtl/volvo-cem-cracke ... r.ino#L129
Vida CEM swapping
- RickHaleParker
- Posts: 7204
- Joined: 25 May 2015, 14:30
- Year and Model: See Signature below.
- Location: Kansas
- Has thanked: 8 times
- Been thanked: 979 times
The "natural order" is what a application will need to unlock the CEM .. right? If so the "natural order" is the CEM pin not the shuffled string. I'm trying to clarify which sequence one would need to pass on to say the application Vdash. Or is it that the sequence order does not matter, just need to get the correct six bytes to unlock the CEM?vtl wrote: 18 Nov 2020, 11:26 The algo fills the bytes in a "natural" way (left to right, ha-ha) and then has the bytes shuffled in a way that will match the actual checking sequence in CEM in order to have the best latency overhead for the good PIN subsequence.
My Teensy 4.0 is out for delivered today.
Last edited by RickHaleParker on 18 Nov 2020, 12:23, edited 1 time in total.
Active
1998 C70, B5234T3, 16T, AW50-42, Bosch Motronic 4.4, Special Edition package.
2017 Ford PIU. 3.5l, Twin Turbo, 365 Hp.
............................
Past
2003 S40, B4204T3, 14T twin scroll AW55-50/51SN, Siemens EMS 2000. ( Killed by a plastic radiator. )
2004 S60R, B8444S TF80 AWD. Yamaha V8 conversion ( I moved, the project did not )
2005 XC90 T6 Executive, B6294T, 4T65 AWD, Bosch Motronic 7.0. ( Transmission dead after sitting for a winter )
1998 C70, B5234T3, 16T, AW50-42, Bosch Motronic 4.4, Special Edition package.
2017 Ford PIU. 3.5l, Twin Turbo, 365 Hp.
............................
Past
2003 S40, B4204T3, 14T twin scroll AW55-50/51SN, Siemens EMS 2000. ( Killed by a plastic radiator. )
2004 S60R, B8444S TF80 AWD. Yamaha V8 conversion ( I moved, the project did not )
2005 XC90 T6 Executive, B6294T, 4T65 AWD, Bosch Motronic 7.0. ( Transmission dead after sitting for a winter )
- RickHaleParker
- Posts: 7204
- Joined: 25 May 2015, 14:30
- Year and Model: See Signature below.
- Location: Kansas
- Has thanked: 8 times
- Been thanked: 979 times
I think I sorted it out. Went back and looked at your dump and compared it to your "Natural order". You are finding the bytes in the order they are stored in Rom. That make your "natural" sequence the decrypted string. The shuffle crypters it into the encrypted CEM Pin.vtl wrote: 18 Nov 2020, 12:21 The "natural order" is positions 0 to 5 (or 1 to 6).
You need to use the "found PIN" pin.
Active
1998 C70, B5234T3, 16T, AW50-42, Bosch Motronic 4.4, Special Edition package.
2017 Ford PIU. 3.5l, Twin Turbo, 365 Hp.
............................
Past
2003 S40, B4204T3, 14T twin scroll AW55-50/51SN, Siemens EMS 2000. ( Killed by a plastic radiator. )
2004 S60R, B8444S TF80 AWD. Yamaha V8 conversion ( I moved, the project did not )
2005 XC90 T6 Executive, B6294T, 4T65 AWD, Bosch Motronic 7.0. ( Transmission dead after sitting for a winter )
1998 C70, B5234T3, 16T, AW50-42, Bosch Motronic 4.4, Special Edition package.
2017 Ford PIU. 3.5l, Twin Turbo, 365 Hp.
............................
Past
2003 S40, B4204T3, 14T twin scroll AW55-50/51SN, Siemens EMS 2000. ( Killed by a plastic radiator. )
2004 S60R, B8444S TF80 AWD. Yamaha V8 conversion ( I moved, the project did not )
2005 XC90 T6 Executive, B6294T, 4T65 AWD, Bosch Motronic 7.0. ( Transmission dead after sitting for a winter )
-
sirloins
- Posts: 43
- Joined: 05 Nov 2020, 18:54
- Year and Model: 2010 V50 T5 AWD M66
- Location: Ottawa, Canada
- Been thanked: 3 times
Almost ready to submit a pull request to vtl for supporting the P1 platform. Thanks a lot for the project vtl!
There was some variability to the response times (two groupings). So my changes are as such:
Shuffle is not necessary since the CEM processes the key in the order presented (in-flash it is still out of order, but that doesn't affect time)
Calculate min/max/average while calculating the crack rate.
Only look at the window 5ms before and 9ms after the average (update average after each candidate key)
Calculate the average ms per key instead of the product/sum.
I was able to do my CEM with 5 samples (more the better of course).
I also did the first 4-bytes, then brute force the last two.
One improvement I would like to make is to have more precision in the buckets, but have less of them. You can see the ms is very close sometimes, so I think if I had more precision in the ms values it would be better (as sometimes it is just 1ms difference in the average, I think I will convert to 0.25ms or so buckets maybe? It seems to help the process go faster with not many samples (only 5 on this try).
The total time it took was 150 seconds.
There was some variability to the response times (two groupings). So my changes are as such:
Shuffle is not necessary since the CEM processes the key in the order presented (in-flash it is still out of order, but that doesn't affect time)
Calculate min/max/average while calculating the crack rate.
Only look at the window 5ms before and 9ms after the average (update average after each candidate key)
Calculate the average ms per key instead of the product/sum.
I was able to do my CEM with 5 samples (more the better of course).
I also did the first 4-bytes, then brute force the last two.
One improvement I would like to make is to have more precision in the buckets, but have less of them. You can see the ms is very close sometimes, so I think if I had more precision in the ms values it would be better (as sometimes it is just 1ms difference in the average, I think I will convert to 0.25ms or so buckets maybe? It seems to help the process go faster with not many samples (only 5 on this try).
The total time it took was 150 seconds.
- RickHaleParker
- Posts: 7204
- Joined: 25 May 2015, 14:30
- Year and Model: See Signature below.
- Location: Kansas
- Has thanked: 8 times
- Been thanked: 979 times
There is a ms timestamp in the J2534 standard. The DiCE units are J2534. If a ms resolution will do. One might be able to develop a app that cracks through a DiCE unit. Hardware may already have.sirloins wrote: 18 Nov 2020, 20:26 You can see the ms is very close sometimes, so I think if I had more precision in the ms values it would be better (as sometimes it is just 1ms difference in the average, I think I will convert to 0.25ms or so buckets maybe? It seems to help the process go faster with not many samples (only 5 on this try).
If a ms resolution produces a small number of byte candidates too close to call, it could be solved by brute forcing the short list.
Active
1998 C70, B5234T3, 16T, AW50-42, Bosch Motronic 4.4, Special Edition package.
2017 Ford PIU. 3.5l, Twin Turbo, 365 Hp.
............................
Past
2003 S40, B4204T3, 14T twin scroll AW55-50/51SN, Siemens EMS 2000. ( Killed by a plastic radiator. )
2004 S60R, B8444S TF80 AWD. Yamaha V8 conversion ( I moved, the project did not )
2005 XC90 T6 Executive, B6294T, 4T65 AWD, Bosch Motronic 7.0. ( Transmission dead after sitting for a winter )
1998 C70, B5234T3, 16T, AW50-42, Bosch Motronic 4.4, Special Edition package.
2017 Ford PIU. 3.5l, Twin Turbo, 365 Hp.
............................
Past
2003 S40, B4204T3, 14T twin scroll AW55-50/51SN, Siemens EMS 2000. ( Killed by a plastic radiator. )
2004 S60R, B8444S TF80 AWD. Yamaha V8 conversion ( I moved, the project did not )
2005 XC90 T6 Executive, B6294T, 4T65 AWD, Bosch Motronic 7.0. ( Transmission dead after sitting for a winter )
-
vtl
- Posts: 4936
- Joined: 16 Aug 2012, 13:35
- Year and Model: 2005 XC70
- Location: Boston
- Has thanked: 130 times
- Been thanked: 686 times
150 seconds, 5 samples only per sub sequence, that's awesome!
Also, what is your CAN bus speed? At 500 Kbps one clock is 2 us, even at 125 Kbps the resolution stays in a single digit us range, not ms.
- RickHaleParker
- Posts: 7204
- Joined: 25 May 2015, 14:30
- Year and Model: See Signature below.
- Location: Kansas
- Has thanked: 8 times
- Been thanked: 979 times
Look at the P1 PC board on page 14. The oscillator crystals are 4.0 Mhz and 8.0 Mhz.
Active
1998 C70, B5234T3, 16T, AW50-42, Bosch Motronic 4.4, Special Edition package.
2017 Ford PIU. 3.5l, Twin Turbo, 365 Hp.
............................
Past
2003 S40, B4204T3, 14T twin scroll AW55-50/51SN, Siemens EMS 2000. ( Killed by a plastic radiator. )
2004 S60R, B8444S TF80 AWD. Yamaha V8 conversion ( I moved, the project did not )
2005 XC90 T6 Executive, B6294T, 4T65 AWD, Bosch Motronic 7.0. ( Transmission dead after sitting for a winter )
1998 C70, B5234T3, 16T, AW50-42, Bosch Motronic 4.4, Special Edition package.
2017 Ford PIU. 3.5l, Twin Turbo, 365 Hp.
............................
Past
2003 S40, B4204T3, 14T twin scroll AW55-50/51SN, Siemens EMS 2000. ( Killed by a plastic radiator. )
2004 S60R, B8444S TF80 AWD. Yamaha V8 conversion ( I moved, the project did not )
2005 XC90 T6 Executive, B6294T, 4T65 AWD, Bosch Motronic 7.0. ( Transmission dead after sitting for a winter )
-
vtl
- Posts: 4936
- Joined: 16 Aug 2012, 13:35
- Year and Model: 2005 XC70
- Location: Boston
- Has thanked: 130 times
- Been thanked: 686 times
Yeah, that makes sense. P2 CEM with Renesas needs ~10x more samples, and it runs at 30 MHz.RickHaleParker wrote: 18 Nov 2020, 22:10 Look at the P1 PC board on page 14. The oscillator crystals are 4.0 Mhz and 8.0 Mhz.
- RickHaleParker
- Posts: 7204
- Joined: 25 May 2015, 14:30
- Year and Model: See Signature below.
- Location: Kansas
- Has thanked: 8 times
- Been thanked: 979 times
Found this in the J2534 API: unsigned long Timestamp;/* receive message timestamp(in microseconds) */vtl wrote: 18 Nov 2020, 22:01 At 500 Kbps one clock is 2 us, even at 125 Kbps the resolution stays in a single digit us range, not ms.
Is it fast enough to do the crack?
Active
1998 C70, B5234T3, 16T, AW50-42, Bosch Motronic 4.4, Special Edition package.
2017 Ford PIU. 3.5l, Twin Turbo, 365 Hp.
............................
Past
2003 S40, B4204T3, 14T twin scroll AW55-50/51SN, Siemens EMS 2000. ( Killed by a plastic radiator. )
2004 S60R, B8444S TF80 AWD. Yamaha V8 conversion ( I moved, the project did not )
2005 XC90 T6 Executive, B6294T, 4T65 AWD, Bosch Motronic 7.0. ( Transmission dead after sitting for a winter )
1998 C70, B5234T3, 16T, AW50-42, Bosch Motronic 4.4, Special Edition package.
2017 Ford PIU. 3.5l, Twin Turbo, 365 Hp.
............................
Past
2003 S40, B4204T3, 14T twin scroll AW55-50/51SN, Siemens EMS 2000. ( Killed by a plastic radiator. )
2004 S60R, B8444S TF80 AWD. Yamaha V8 conversion ( I moved, the project did not )
2005 XC90 T6 Executive, B6294T, 4T65 AWD, Bosch Motronic 7.0. ( Transmission dead after sitting for a winter )
-
- Similar Topics
- Replies
- Views
- Last post
-
- 1 Replies
- 9221 Views
-
Last post by RickHaleParker
-
- 6 Replies
- 9137 Views
-
Last post by abscate
-
- 27 Replies
- 28331 Views
-
Last post by cn90
-
- 10 Replies
- 10596 Views
-
Last post by jonesg
-
- 7 Replies
- 5733 Views
-
Last post by RickHaleParker






