pazi88 wrote:
Isn't the communication 512bit RSA encrypted to ms45 so maybe it's that?
I think you’re right. I didn’t realize most communication would be encrypted.
Quote:
BTW guys, MS45 was the first ecu in the 3 series to be secured with BMW's SAM (security and authentication) module. The ecu is secured with two RSA keys - one for login (aka seed/key) and one to digitally sign the calibration data.
Here's the signature routine:
ROM:FFF083D8 # =============== S U B R O U T I N E =======================================
ROM:FFF083D8
ROM:FFF083D8
ROM:FFF083D8 SIG_CHK: # CODE XREF: ROM:FFF0F67Cp
ROM:FFF083D8 # ROM:FFF0FF38p ...
ROM:FFF083D8
ROM:FFF083D8 .set var_10, -0x10
ROM:FFF083D8 .set var_4, -4
ROM:FFF083D8 .set arg_4, 4
ROM:FFF083D8
ROM:FFF083D8 stwu sp, var_10(sp)
ROM:FFF083DC mflr r0
ROM:FFF083E0 stw r31, 0x10+var_4(sp)
ROM:FFF083E4 stw r0, 0x10+arg_4(sp)
ROM:FFF083E8 lwz r12, ((off_FFF09C94+0x636C) & 0xFFFF)(r6)
ROM:FFF083EC cmplwi r12, 0x10
ROM:FFF083F0 ble loc_FFF083FC
ROM:FFF083F4 li r3, -1
ROM:FFF083F8 b loc_FFF0841C
ROM:FFF083FC # ---------------------------------------------------------------------------
ROM:FFF083FC
ROM:FFF083FC loc_FFF083FC: # CODE XREF: SIG_CHK+18j
ROM:FFF083FC lis r31, ((SIG_MODULUS+0x10000) >> 16)
ROM:FFF08400 addi r31, r31, -0x627C # SIG_MODULUS
ROM:FFF08404 lis r11, ((CALC_SIG+0x10000) >> 16)
ROM:FFF08408 addi r11, r11, -0x7964 # CALC_SIG
ROM:FFF0840C mtlr r11
ROM:FFF08410 addi r8, r31, 0x48
ROM:FFF08414 addi r7, r31, 0
ROM:FFF08418 blrl
ROM:FFF0841C
ROM:FFF0841C loc_FFF0841C: # CODE XREF: SIG_CHK+20j
ROM:FFF0841C lwz r0, 0x10+arg_4(sp)
ROM:FFF08420 lwz r31, 0x10+var_4(sp)
ROM:FFF08424 mtlr r0
ROM:FFF08428 addi sp, sp, 0x10
ROM:FFF0842C blr
ROM:FFF0842C # End of function SIG_CHK
That I'm aware of, the RSA modulus for the signatures has been factored by one and only one team, and one of the two members (the other being my partner for 23 years) is typing this. We factored a 512 bit RSA modulus in 14 days using custom/optimized hardware and an optimized version of the general number field sieve algorithm. This was back in 2007. We kept the "how" silent back then because 512 modulii were used in SSL and banking and we really didn't want "the bad guys" to know our factoring capabilities.