Dataset Open Access

From A to Z: Projective coordinates leakage in the wild: research data and tooling

Aldaya, Alejandro Cabrera; Pereida Garcia, Cesar; Brumley, Billy Bob


Citation Style Language JSON Export

{
  "publisher": "Zenodo", 
  "DOI": "10.5281/zenodo.3752635", 
  "title": "From A to Z: Projective coordinates leakage in the wild: research data and tooling", 
  "issued": {
    "date-parts": [
      [
        2020, 
        4, 
        15
      ]
    ]
  }, 
  "abstract": "<p>Description</p>\n\n<p>This dataset and software tool are for reproducing the research results related to CVE-2020-10932 and CVE-2020-11735, resulting from the article &quot;From A to Z: Projective coordinates leakage in the wild&quot; (to appear at CHES 2020). The data was used to carry out the attack in Section 6 of the article.</p>\n\n<p>Data format</p>\n\n<p>txt files</p>\n\n<p>The <code>[int].txt</code> files contain an encoded page-fault trace prefixed by <code>trace:</code>.</p>\n\n<p>A trace represents the sequence of tracked memory pages that were executed during the generation of an ECDSA signature. The trace is encoded using ASCII characters for better visualization.</p>\n\n<p>The encoding follows this table:</p>\n\n<pre><code class=\"language-markdown\">| Functions              | Symbol | Page offset |\n| ---------------------- |:------:|:-------:|\n| _gcry_ecc_ecdsa_sign   |    T   | 0xa1000 |\n| _gcry_mpi_invm         |    .   | 0xcf000 |\n| _gcry_mpi_set          |    S   | 0xd5000 |\n| _gcry_mpi_add          |    A   | 0xcd000 |\n| _gcry_mpih_sub_n       |    -   | 0xd8000 |\n| _gcry_mpih_rshift      |    -   | 0xd8000 |</code></pre>\n\n<p><code>_gcry_ecc_ecdsa_sign</code> is the highest level function tracked in the attack. This allows to differentiate different calls to the <code>_gcry_mpi_invm</code> function which contains an insecure version of a Binary Extended Euclidean Algorithm (BEEA).</p>\n\n<p>Using these pages it is possible to locate the execution of <code>_gcry_mpi_invm</code> corresponding to the computation of <code>Z mod p</code> during projective to affine coordinates conversion (see <code>preprocess_trace</code> function).</p>\n\n<p>It can be seen, that <code>_gcry_mpih_sub_n</code> and <code>_gcry_mpih_rshift</code> shares a page. However, they can be differentiated using mainly the caller memory page. This sharing, instead of being a drawback, allows a straightforward recovery of BEEA execution flow (see <code>extract_Zi</code> and <code>extract_Xi</code> functions in <code>recover_z.py</code>).</p>\n\n<p>dat files</p>\n\n<p>The format of the <code>[int].dat</code> files is as follows.</p>\n\n<ul>\n\t<li><code># X [hex]</code>: Ground truth projective output of scalar multiplication, before affine conversion</li>\n\t<li><code># Y [hex]</code>: Ground truth projective output of scalar multiplication, before affine conversion</li>\n\t<li><code># Z [hex]</code>: Ground truth projective output of scalar multiplication, before affine conversion</li>\n\t<li><code># curve_name [str]</code>: The curve (P256)</li>\n\t<li><code># h [hex]</code>: Hash of the message to be signed</li>\n\t<li><code># k [hex]</code>: Ground truth ECDSA nonce</li>\n\t<li><code># q [hex]</code>: Curve order</li>\n\t<li><code># r [hex]</code>: First component of the ECDSA signature</li>\n\t<li><code># s [hex]</code>: Second component of the ECDSA signature</li>\n\t<li><code># x [hex]</code>: Ground truth ECDSA private key</li>\n\t<li><code># y [hex] [hex]</code>: Public key coordinates</li>\n\t<li><code># leak_pad [int],[int],[int]</code>: Leakage recovered during backtracking. Example: <code>0,4,15 =&gt; 0 = k % 2**4 = k &amp; 15</code></li>\n</ul>\n\n<p>Tooling</p>\n\n<p>The <code>recover_z.py</code> script</p>\n\n<ul>\n\t<li>Loads a trace.</li>\n\t<li>Recovers the corresponding Z coordinate from the trace data.</li>\n\t<li>verifies the recovered Z matches the ground truth Z.</li>\n</ul>\n\n<p>Example</p>\n\n<p>Unpack the data:</p>\n\n<pre><code>tar xf traces.tar.gz</code></pre>\n\n<p>Run the tooling on trace index 123:</p>\n\n<pre><code>$ python2 recover_z.py 123\nINFO:recovered Z:65b9b7006bc7b030218bef1b6e569f9f7acaee059b53d669388c6b860f67e213\nINFO:     real Z:65b9b7006bc7b030218bef1b6e569f9f7acaee059b53d669388c6b860f67e213</code></pre>\n\n<p>The output demonstrates the recovered Z coordinate is correct, i.e. matches the ground truth.</p>\n\n<p>Credits</p>\n\n<p>Authors</p>\n\n<ul>\n\t<li>Alejandro Cabrera Aldaya (Tampere University, Tampere, Finland)</li>\n\t<li>Cesar Pereida Garc&iacute;a (Tampere University, Tampere, Finland)</li>\n\t<li>Billy Bob Brumley (Tampere University, Tampere, Finland)</li>\n</ul>\n\n<p>Funding</p>\n\n<p>This project has received funding from the European Research Council (ERC) under the European Union&rsquo;s Horizon 2020 research and innovation programme (grant agreement No 804476).</p>\n\n<p>License</p>\n\n<p>This project is distributed under MIT license.</p>\n\n<p>&nbsp;</p>", 
  "author": [
    {
      "family": "Aldaya, Alejandro Cabrera"
    }, 
    {
      "family": "Pereida Garcia, Cesar"
    }, 
    {
      "family": "Brumley, Billy Bob"
    }
  ], 
  "id": "3752635", 
  "event-place": "Beijing, China", 
  "version": "1", 
  "type": "dataset", 
  "event": "Conference on Cryptographic Hardware and Embedded Systems 2020 (CHES 2020)"
}
140
47
views
downloads
All versions This version
Views 140140
Downloads 4747
Data volume 2.3 GB2.3 GB
Unique views 123123
Unique downloads 2222

Share

Cite as