Obfuscation.htm 16.8 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442
<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 9">
<meta name=Originator content="Microsoft Word 9">
<link rel=File-List href="./Obfuscation_files/filelist.xml">
<link rel=Edit-Time-Data href="./Obfuscation_files/editdata.mso">
<link rel=OLE-Object-Data href="./Obfuscation_files/oledata.mso">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<title>Obfuscation method for DDR</title>
<!--[if gte mso 9]><xml>
 <o:DocumentProperties>
  <o:Author>pramila</o:Author>
  <o:Template>Normal</o:Template>
  <o:LastAuthor>pramila</o:LastAuthor>
  <o:Revision>2</o:Revision>
  <o:TotalTime>1263</o:TotalTime>
  <o:LastPrinted>2002-07-03T22:29:00Z</o:LastPrinted>
  <o:Created>2002-07-05T23:03:00Z</o:Created>
  <o:LastSaved>2002-07-05T23:03:00Z</o:LastSaved>
  <o:Pages>5</o:Pages>
  <o:Words>763</o:Words>
  <o:Characters>4353</o:Characters>
  <o:Company>RouteFree</o:Company>
  <o:Lines>36</o:Lines>
  <o:Paragraphs>8</o:Paragraphs>
  <o:CharactersWithSpaces>5345</o:CharactersWithSpaces>
  <o:Version>9.3821</o:Version>
 </o:DocumentProperties>
</xml><![endif]-->
<style>
<!--
 /* Font Definitions */
@font-face
	{font-family:Wingdings;
	panose-1:5 0 0 0 0 0 0 0 0 0;
	mso-font-charset:2;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:0 268435456 0 0 -2147483648 0;}
 /* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
h1
	{mso-style-next:Normal;
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	page-break-after:avoid;
	mso-outline-level:1;
	font-size:14.0pt;
	mso-bidi-font-size:12.0pt;
	font-family:"Times New Roman";
	mso-font-kerning:0pt;
	font-weight:normal;}
h2
	{mso-style-next:Normal;
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	page-break-after:avoid;
	mso-outline-level:2;
	font-size:12.0pt;
	font-family:"Times New Roman";}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
 /* List Definitions */
@list l0
	{mso-list-id:316111552;
	mso-list-type:hybrid;
	mso-list-template-ids:-1053139648 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:.5in;
	mso-level-number-position:left;
	text-indent:-.25in;
	font-family:Symbol;}
@list l1
	{mso-list-id:1183472765;
	mso-list-type:hybrid;
	mso-list-template-ids:-1012208588 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l1:level1
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:.5in;
	mso-level-number-position:left;
	text-indent:-.25in;
	font-family:Symbol;}
@list l2
	{mso-list-id:1590001041;
	mso-list-type:hybrid;
	mso-list-template-ids:-36954988 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l2:level1
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:.5in;
	mso-level-number-position:left;
	text-indent:-.25in;
	font-family:Symbol;}
ol
	{margin-bottom:0in;}
ul
	{margin-bottom:0in;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="2050"/>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1"/>
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US style='tab-interval:.5in'>

<div class=Section1>

<h1><b>Obfuscation method for DDR<o:p></o:p></b></h1>

<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

<p class=MsoNormal>This is implemented in RI for all memory accesses. It
consists of two parts, the address obfuscation and data masking. Both are
associated with keys, which are dynamically generated and change for every run
of the game. The address obfuscation is an invertible scrambling and addition
(xor)<span style="mso-spacerun: yes">  </span>on addresses to</p>

<ul style='margin-top:0in' type=disc>
 <li class=MsoNormal style='mso-list:l1 level1 lfo1;tab-stops:list .5in'>Make
     it difficult to infer the layout of code and data on DDR in run time</li>
 <li class=MsoNormal style='mso-list:l1 level1 lfo1;tab-stops:list .5in'>Make
     it difficult to run third party code from DDR.</li>
</ul>

<p class=MsoNormal>The data masking is a simple data transformation to hide
data on the chip- DDR interface.</p>

<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

<p class=MsoNormal><b>Address obfuscation</b>:</p>

<p class=MsoNormal>Address obfuscation consists of a permutation and xor.
(Substitution is not feasible).</p>

<p class=MsoNormal>There are 24 address bits that reference 16MB of DDR memory.
Of these the lower order 7 bits represent 128 bit blocks which cannot be
scrambled, so we safely assume we scramble 16 higher bits. </p>

<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

<p class=MsoNormal>In order to reduce complexity we do not allow the entire set
of 16! permutations of these 16 bits. We break up into 4 sets of 4 bits each.
So we need </p>

<ul style='margin-top:0in' type=disc>
 <li class=MsoNormal style='mso-list:l0 level1 lfo2;tab-stops:list .5in'>two
     bits for each set to describe its ordering (total = 2*4 = 8) </li>
 <li class=MsoNormal style='mso-list:l0 level1 lfo2;tab-stops:list .5in'>two
     bits per address bit for its ordering within the group (total = 2*4*4 = 32
     for all four groups)</li>
</ul>

<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

<p class=MsoNormal>With just the bits within each group scrambled, it will give
us 4! * 4! *4! *4! orderings = 331776 possibilities of address scrambling,
which means that one would need to observe 331776 known plaintext (actual
address values) to derive the keys. Adding the permutations of groups itself,
there are 4! Ways of ordering the 4 groups, so that results in 7962624 orderings,
which is about 8 million known plaintext, assuming all permutations are equally
likely. </p>

<p class=MsoNormal><span style="mso-spacerun: yes"> </span>(For comparison, 16!
is 20 x 10^12.)</p>

<p class=MsoNormal>For simplicity I will denote these address lines A0-A16.</p>

<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

<p class=MsoNormal><b>Remember the software generated select bits should be
valid permutations with no repetitions</b>.</p>

<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

<p class=MsoNormal><!--[if gte vml 1]><v:shapetype id="_x0000_t75" coordsize="21600,21600"
 o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f"
 stroked="f">
 <v:stroke joinstyle="miter"/>
 <v:formulas>
  <v:f eqn="if lineDrawn pixelLineWidth 0"/>
  <v:f eqn="sum @0 1 0"/>
  <v:f eqn="sum 0 0 @1"/>
  <v:f eqn="prod @2 1 2"/>
  <v:f eqn="prod @3 21600 pixelWidth"/>
  <v:f eqn="prod @3 21600 pixelHeight"/>
  <v:f eqn="sum @0 0 1"/>
  <v:f eqn="prod @6 1 2"/>
  <v:f eqn="prod @7 21600 pixelWidth"/>
  <v:f eqn="sum @8 21600 0"/>
  <v:f eqn="prod @7 21600 pixelHeight"/>
  <v:f eqn="sum @10 21600 0"/>
 </v:formulas>
 <v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/>
 <o:lock v:ext="edit" aspectratio="t"/>
</v:shapetype><v:shape id="_x0000_i1025" type="#_x0000_t75" style='width:6in;
 height:306.75pt' o:ole="">
 <v:imagedata src="./Obfuscation_files/image001.wmz" o:title=""/>
</v:shape><![endif]--><![if !vml]><img width=576 height=409
src="./Obfuscation_files/image002.gif" v:shapes="_x0000_i1025"><![endif]><!--[if gte mso 9]><xml>
 <o:OLEObject Type="Embed" ProgID="Word.Document.8" ShapeID="_x0000_i1025"
  DrawAspect="Content" ObjectID="_1087390241">
 </o:OLEObject>
</xml><![endif]--></p>

<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

<p class=MsoNormal><!--[if gte vml 1]><v:shape id="_x0000_i1026" type="#_x0000_t75"
 style='width:6in;height:261.75pt' o:ole="">
 <v:imagedata src="./Obfuscation_files/image003.wmz" o:title=""/>
</v:shape><![endif]--><![if !vml]><img width=576 height=349
src="./Obfuscation_files/image004.gif" v:shapes="_x0000_i1026"><![endif]><!--[if gte mso 9]><xml>
 <o:OLEObject Type="Embed" ProgID="Word.Document.8" ShapeID="_x0000_i1026"
  DrawAspect="Content" ObjectID="_1087390242">
 </o:OLEObject>
</xml><![endif]--></p>

<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

<p class=MsoNormal>For example, a resulting permutation using the above result
G1, G0, G2, G3 could be</p>

<p class=MsoNormal>A4, A6, A7,A5, A0,A1, A3,A2, A10,A11,A7,A8, A12,A14,A13,A15</p>

<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

<ul style='margin-top:0in' type=disc>
 <li class=MsoNormal style='mso-list:l2 level1 lfo3;tab-stops:list .5in'><b>Addition<o:p></o:p></b></li>
</ul>

<p class=MsoNormal>In order to add some more confusion into the address
obfuscation, we bitwise xor a random 16 bit key to the bits on the address bus
after permutation.</p>

<p class=MsoNormal>New A0-A16 = A0-A16 xor K1-K16 </p>

<p class=MsoNormal>Where K0-K16 is a random 16 bit pattern.</p>

<p class=MsoNormal>This adds 65536 possibilities to deciphering this key.</p>

<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

<h2>Data masking</h2>

<p class=MsoNormal><b><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></b></p>

<p class=MsoNormal>Data masking is achieved by calculating a mask which is
xor’ed to data bits after the data bits are read. This mask is a function of
the scrambled address, and another key used in the following scrambling circuit
based on a feedback shift register PN generator to create a mask for data. This
logic could be exercised in parallel with the data fetched/written<span
style="mso-spacerun: yes">  </span>from/to<span style="mso-spacerun: yes"> 
</span>DDR.</p>

<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

<h2>Mask generation circuit</h2>

<p class=MsoNormal>Two possibilities, depending on what we can implement, are
shift register based and substitution table based:</p>

<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

<p class=MsoNormal><b>Shift register based</b>:</p>

<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

<p class=MsoNormal>For the purpose of creating 64 bit shift registers, here are
few connections which will lead to primitive polynomials</p>

<ul style='margin-top:0in' type=disc>
 <li class=MsoNormal style='mso-list:l2 level1 lfo3;tab-stops:list .5in'>(59,
     6,5,4,3,1,0) (that is x^59 + x^6 + x^5 + x^4 + x^3 + x^1 +<span
     style="mso-spacerun: yes">  </span>1)</li>
 <li class=MsoNormal style='mso-list:l2 level1 lfo3;tab-stops:list .5in'>(54,
     6,5,4,3,2,0)</li>
 <li class=MsoNormal style='mso-list:l2 level1 lfo3;tab-stops:list .5in'>(48,7,5,4,2,1,0)</li>
</ul>

<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

<p class=MsoNormal>Since we plan to hardwire the connections, we could pick one
of these.</p>

<p class=MsoNormal>We generate 48 bits of random key to be used as a constant
for one run of the game. We use the 16 bits of scrambled address bits and input
this as state to the feedback shift register. If we clock through this FSR 64
times we get 64 bits as output. (Or implement the equivalent as a table
lookup). This is a cheap way of accomplishing hash(key, address). This is the
mask for the data read from the DDR, or to be written to DDR.</p>

<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

<p class=MsoNormal><!--[if gte vml 1]><v:shape id="_x0000_i1027" type="#_x0000_t75"
 style='width:6in;height:171.75pt' o:ole="">
 <v:imagedata src="./Obfuscation_files/image005.wmz" o:title=""/>
</v:shape><![endif]--><![if !vml]><img width=576 height=229
src="./Obfuscation_files/image006.gif" v:shapes="_x0000_i1027"><![endif]><!--[if gte mso 9]><xml>
 <o:OLEObject Type="Embed" ProgID="Word.Document.8" ShapeID="_x0000_i1027"
  DrawAspect="Content" ObjectID="_1087390243">
 </o:OLEObject>
</xml><![endif]--></p>

<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

<p class=MsoNormal><b>Matrix based substitution</b>:</p>

<p class=MsoNormal>A substitution based scheme would be to take the 64 bits
from the (key, address) combination and store into a 4x4 array, each element
being 4 bits</p>

<p class=MsoNormal>(This is an AES like scheme).</p>

<p class=MsoNormal>[d15 d14 d13 d12] = r0</p>

<p class=MsoNormal>[d11 d10 d9 d8] = r1</p>

<p class=MsoNormal>[d7 d6 d5 d4] = r2</p>

<p class=MsoNormal>[d3 d2 d1 d0] = r3</p>

<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

<p class=MsoNormal>Then shift r1 by one bit to the right, r2 by two, r3 by
three.</p>

<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

<p class=MsoNormal>Then lookup a 16 entry table (generated once for each game)
to lookup and substitute each value.</p>

<p class=MsoNormal>Resulting in: </p>

<p class=MsoNormal>[s15 s14 s13 s12]</p>

<p class=MsoNormal>[s11 s10 s9 s8]</p>

<p class=MsoNormal>[s7 s6 s5 s4]</p>

<p class=MsoNormal>[s3 s2 s1 s0]</p>

<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

<p class=MsoNormal>The resulting mask is copied out columnwise as:</p>

<p class=MsoNormal>[s15 s11 s7 s3 s14 s10 s6 s2 s13 s9 s5 s1 s12 s8 s4 s0]</p>

<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

<p class=MsoNormal>This is xored with data from DDR. This method is probably
more secure, provided the 16 entry lookup is feasible.</p>

<p class=MsoNormal><!--[if gte vml 1]><v:shape id="_x0000_i1028" type="#_x0000_t75"
 style='width:6in;height:13.5pt' o:ole="">
 <v:imagedata src="./Obfuscation_files/image007.wmz" o:title=""/>
</v:shape><![endif]--><![if !vml]><img width=576 height=18
src="./Obfuscation_files/image008.gif" v:shapes="_x0000_i1028"><![endif]><!--[if gte mso 9]><xml>
 <o:OLEObject Type="Embed" ProgID="Word.Document.8" ShapeID="_x0000_i1028"
  DrawAspect="Content" ObjectID="_1087390244">
 </o:OLEObject>
</xml><![endif]--></p>

<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

<h2>Inverting the whole scheme:</h2>

<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

<p class=MsoNormal>The address is inverted by inverting the permutation and the
key xor. The shift register operation is done again to obtain the mask and is
applied to the data.</p>

<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

<p class=MsoNormal><b>Attack</b>:</p>

<p class=MsoNormal>To attack this system, assuming someone has known plaintext
from an illegal version of the same game, one would have to, after the game
starts running, run the searching algorithm to determine these keys. Then he
can make his DDR masquerade as ours. Since we have three random quantities, the
search space multiplies. But still it should be pretty hard to be able to do
this reliably every time without causing enough delay before the illegal game
can start running.</p>

<p class=MsoNormal>To create a new game, one would have to record the data on
the bus. Then analyse it to obtain the keys and use it with the above system to
plug into our DDR. It is probably not trivial but not impossible….<span
style='font-family:Wingdings;mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman";mso-char-type:symbol;mso-symbol-font-family:
Wingdings'><span style='mso-char-type:symbol;mso-symbol-font-family:Wingdings'>J</span></span></p>

<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>

</div>

</body>

</html>