Homemade_Keeloq_II

Flag: ECW{w0w_Th4t_w4s_sUp3r_s3cUr3_53217}

Challenge

file-archive
5KB
circle-info

Description


Your mission : Find the next key value (again?!), more information given in the source.

Flag is in the format ECW{w0w_Th4t_w4s_sUp3r_s3cUr3_NEXTKEY}. NEXTKEY being the next 16 bit key in decimal format.

Challenge made by:

Solution

Ce challenge est la suite de Homemade_Keeloq_I. On réutilise le même parser et on obtient :

{'fixed': '1', 'vlow': '0', 'button_status_1': '1110', 'serial': 184232904, 'button_status_2': '0010', 'discrimination': 746, 'counter': 210}
{'fixed': '1', 'vlow': '0', 'button_status_1': '1110', 'serial': 184232900, 'button_status_2': '0001', 'discrimination': 746, 'counter': 10629}
{'fixed': '1', 'vlow': '0', 'button_status_1': '1110', 'serial': 184232904, 'button_status_2': '0010', 'discrimination': 746, 'counter': 40800}
{'fixed': '1', 'vlow': '0', 'button_status_1': '1110', 'serial': 184232900, 'button_status_2': '0001', 'discrimination': 746, 'counter': 25187}
{'fixed': '1', 'vlow': '0', 'button_status_1': '1110', 'serial': 184232904, 'button_status_2': '0010', 'discrimination': 746, 'counter': 29326}

C’est un polynôme interpolé sur des points consécutifs, on peut utiliser les différences finie :

x
y
Δ¹
Δ²
Δ³
Δ⁴

0

210

1

10629

10629−210=10419

2

40800

40800−10629=30171

30171−10419=19752

3

25187

25187−40800=−15613≡49923

49923−30171=19752

0

4

29326

29326−25187=4139

4139−49923=−45784≡19752

0

0

Les différences stabilisent à Δ⁴=0 → degré 3 polynôme

Pour points uniformes,

f(n)=y0+nΔ01+n(n1)2!Δ02+n(n1)(n2)3!Δ03+f(n) = y_0 + n\,\Delta^1_0 + \frac{n(n - 1)}{2!}\,\Delta^2_0 + \frac{n(n - 1)(n - 2)}{3!}\,\Delta^3_0 + \cdots

Les valeurs :

  • Δ¹₀ = 10419

  • Δ²₀ = 19752

  • Δ³₀ = 0

f(x)=210+10419x1!+19752x(x1)2!(mod65536)f(x) = 210 + 10419 \, \frac{x}{1!} + 19752 \, \frac{x \, (x - 1)}{2!} \pmod{65536}

En python ça nous donne :

Mis à jour