Skip to content

Commit 7a667c4

Browse files
Update notes.md
formatting
1 parent 57f33da commit 7a667c4

File tree

1 file changed

+38
-41
lines changed

1 file changed

+38
-41
lines changed

the_imposters/notes.md

Lines changed: 38 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ In fact, we found our input and output corrolations were right next to each othe
1717
We've tried upping the trace count to 100k, and doing expansive SBox and MixColumn based attacks. We also re-ran the IKM attack to make sure we had the parameters correct. With our setup, we can mount that two-round attack with roughly 60 traces. There's no way we need more than 100k to get The Imposters.
1818

1919
However, analysis of Car Key Fob Hardware Backdoor traces showed a very similar pattern, that we think is likely hardware AES. The theory is that the distinctive block/block/small-block/block pattern we see is actually:
20-
* loading the 16-byte AES key
21-
* loading the plaintext
22-
* doing the HW AES routine
23-
* reading out the ciphertext
20+
* loading the 16-byte AES key
21+
* loading the plaintext
22+
* doing the HW AES routine
23+
* reading out the ciphertext
2424

2525
The data correlations and timings all line up for this. Assuming it's the case, we then have 16 hardware AES operations, of which 15 are imposters, and one is real. We can easily identify the real one by using data correlations. Also, we note that which operation has correlations varies per reset. Next step: mount a hardware AES attack on the identified operation.
2626

2727
References:
28-
https://wiki.newae.com/Tutorial_A6_Replication_of_Ilya_Kizhvatov%27s_XMEGA%C2%AE_Attack
29-
http://www.iacr.org/phds/106_ilyakizhvatov_physicalsecuritycryptographica.pdf
28+
* https://wiki.newae.com/Tutorial_A6_Replication_of_Ilya_Kizhvatov%27s_XMEGA%C2%AE_Attack
29+
* http://www.iacr.org/phds/106_ilyakizhvatov_physicalsecuritycryptographica.pdf
3030

3131
## Installing and Configuring Jlsca
3232
1. Go to [Julia Install instruction](https://julialang.org/downloads/platform.html)
@@ -42,7 +42,7 @@ using IJulia; notebook()
4242

4343

4444
## Results
45-
The class of attack used was based upon Ilya's work referenced above.
45+
The class of attack used was based upon Ilya's work referenced above.
4646
When Ilya's attacks were fully operational It worked perfectly on the example traces, the imposters... not so much.
4747

4848

@@ -54,8 +54,8 @@ Candidates:
5454
3fc0d0ee29d56b852806b843db10c731
5555

5656
### Hunting for targets
57-
I now believe that what sort of correlations appear differ from what Ilya saw.
58-
I am hunting for better models.
57+
I now believe that what sort of correlations appear differ from what Ilya saw.
58+
I am hunting for better models.
5959
Note: because previous keybyte and data are Null for the first target, it's an easier thing to hit...
6060

6161
```python
@@ -69,56 +69,53 @@ rank: 1, candidate: 0xc0, peak: 0.447334 @ 1726
6969

7070
(prevData ⊻ previousKeyByte) ⊻ (nowData ⊻ guess) ⊻ a.sbox[(nowData ⊻ guess)+1]
7171
rank: 1, candidate: 0x00, peak: 0.145686 @ 1835
72-
7372
```
7473

7574
Analysis:
76-
- the sbox hit is too huge to ignore... but only catches one keybyte
77-
- ...
78-
75+
- the sbox hit is too huge to ignore... but only catches one keybyte
76+
- ...
7977

80-
Reasonable Hits:
78+
### Reasonable Hits:
8179
(nowData ⊻ guess) ⊻ a.sbox[(nowData ⊻ guess)+1]
82-
-> 0071af0e4d49b430d9d08c46403d2649
83-
- super strong hit on first keybyte, garbage on rest
84-
- retried with forced first byte: 00, c0, a3
80+
- Result: 0071af0e4d49b430d9d08c46403d2649
81+
- super strong hit on first keybyte, garbage on rest
82+
- retried with forced first byte: 00, c0, a3
8583

8684
(nowData ⊻ guess) ⊻ a.sbox[(nowData ⊻ guess)+1] ⊻ a.sbox[(prevData ⊻ previousKeyByte)+1]
87-
-> a31002ef5bcd05ffa4da9a8d6f6dc1b0
88-
- reasonable hits on multiple bytes
85+
- Result: a31002ef5bcd05ffa4da9a8d6f6dc1b0
86+
- reasonable hits on multiple bytes
8987

9088
(nowData ⊻ guess) ⊻ (prevData ⊻ previousKeyByte)
91-
- this is Ilya's target. Works flawlessly for his sample set.
92-
-> c0c0c0c0c0c0c0c0c080808080808080
93-
- above: pretty solid hits, must be noisish
94-
-> 3f8cafd88968afd9946bbef38d72084c
95-
- above: with many 100k traces, flipHW and progressive on. That looks keyish.
96-
->
97-
- above: with many 100k traces, HW and progressive on. That looks keyish.
89+
- this is Ilya's target. Works flawlessly for his sample set.
90+
- Result: c0c0c0c0c0c0c0c0c080808080808080
91+
- above: pretty solid hits, must be noisish
92+
- Result: 3f8cafd88968afd9946bbef38d72084c
93+
- above: with many 100k traces, flipHW and progressive on. That looks keyish.
94+
- Result: ???
95+
- above: with many 100k traces, HW and progressive on. That looks keyish.
9896

9997
(nowData ⊻ guess) ⊻ (prevData ⊻ previousKeyByte) ⊻ a.sbox[(nowData ⊻ guess)+1]
100-
-> 003e01336712f0264e439db1cd5569df
101-
- some hits, mostly noise...
98+
- Result: 003e01336712f0264e439db1cd5569df
99+
- some hits, mostly noise...
102100

103101
(nowData ⊻ guess) ⊻ (prevData ⊻ previousKeyByte) ⊻ a.sbox[(nowData ⊻ guess)+1]
104-
-> 80...
105-
- hit is pretty solid. Actually on (data ⊻ 0x00 ⊻ 0x00 ⊻ 0x80 ⊻ a.sbox(data^guess))
106-
- which is interesting, because it suggests a previousByte of 80 for the first
102+
- Result: 80...
103+
- hit is pretty solid. Actually on (data ⊻ 0x00 ⊻ 0x00 ⊻ 0x80 ⊻ a.sbox(data^guess))
104+
- which is interesting, because it suggests a previousByte of 80 for the first
107105

108106

109107
Analysis:
110-
* SBox In XOR Out gives a good hit for the first
111-
- But crap for subsequent. Maybe one of the "guess"s should be prev?
112-
- might be bogus, didn't find it on 100k trace.
113-
* ARK XOR last-ARK gives solid, across the board hits
114-
- but BS key.
115-
- forcing progressive fixes that, gives reasonable offsets, key is invalid
116-
* Note that for ARK XOR lARK, the first hit is weirdly positioned
117-
- might be because of an odd "previous"
118-
- obvious candidate before is 4f
108+
* SBox In XOR Out gives a good hit for the first
109+
- But crap for subsequent. Maybe one of the "guess"s should be prev?
110+
- might be bogus, didn't find it on 100k trace.
111+
* ARK XOR last-ARK gives solid, across the board hits
112+
- but BS key.
113+
- forcing progressive fixes that, gives reasonable offsets, key is invalid
114+
* Note that for ARK XOR lARK, the first hit is weirdly positioned
115+
- might be because of an odd "previous"
116+
- obvious candidate before is 4f
119117

120118
## Known Key Attacks
121119
Since we couldn't get the key to fall out, we tried another tack. We wrote our own version of the challenge for an XMEGA 128 A3U processor we had, and went hunting for known-key on it. We found that the key bytes we correlated diagonally. A little math later, we found they were being processed in ShiftRows order.
122120

123121
Armed with that knowledge, we were able to mount an attack that worked on our known-key version, and which transferred to the RHme3 target. Success.
124-

0 commit comments

Comments
 (0)