1

I really liked the answer in this post:

Defeat rsa hash verification

However I do not really understand this part:

"taking the signature s raised to the power of 3 modulus n we wind up with the following value"

I see where the strings come from but could someone point me to a box filling operation or perhaps some OpenSSL code so that I can generate the resultant string shown.

1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff003021300906052b0e03021a050004145e3246e50a4dad079a61f99fa3297c01d802e038

I have a VAG MIB2 with QNX, which uses the metachecksum and signatures. So I feel that if I can emulate the process described, I'd have a go and see where it leads.

1

The hint is right there in the quoted text:

taking the signature s raised to the power of 3 modulus n we wind up with the following value

This is the classical RSA decryption operation.

In our case:

s=0xa73e111de512e09bad2dc08eff685a384fc032192a20fd1e242ad64af5b509a76a7432f754aff0d6b74a7ec2072cbb11e91f68f569508b77712d1869edd6d0b9923eb77ba815dba8e44d5e09412cdf2e830518f3b38d48df892a3a0c65cc67f109e5e0f5f06ce0376d032ab21051510f3dab7f75fcdf54a96d8aa7f3c617f76d
e=3
n=0xC0F389EEC7B66C9DC736508FF88AEB1FB113942EAD020814D08D29E868F14B2086BCD7DDCCBA7559F999E76D24619660BBE17434DA59988087F2A99CD465B1FF423522B78CB0DE463A669613D356DFA9E86E0E2E0B6DAB5DE89131C5A0727AEAB1767278AB101DCD9C3CFC1026705C1DAB3BF53BF50AFAFB3F52DA2CEB0BEE57

Calculation can be done in any calculator supporting long numbers. I usually use Python, since it has the pow function which accepts the modulo.

>>> x = pow(s, e, n)
>>> hex(x)
'0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff003021300906052b0e03021a050004145e3246e50a4dad079a61f99fa3297c01d802e038L'
>>>

2
  • Much appreciated. The question now is whether the original post had the MIB2 public key. Will play about with it. But anyone feel free to supply the public MIB2 key if you know it. – Tell Aug 8 '17 at 17:12
  • OK they are indeed the MIB2 "public" keys in the original post since the process tallies with VAG POI metainfo2.txt files generated for the unit. Not sure what unit the original poster had except it was QNX based but sort of assumed that the keys would be the same. Supplementary question on "Just modify the parts of the file you need to modify, recalculate the SHA1 and update MetafileChecksum.". Is there a process that I can do to re signature the file after I have changed it with the same "public keys". Thanks. – Tell Aug 12 '17 at 15:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.