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


DataCite XML Export

<?xml version='1.0' encoding='utf-8'?>
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://datacite.org/schema/kernel-4" xsi:schemaLocation="http://datacite.org/schema/kernel-4 http://schema.datacite.org/meta/kernel-4.1/metadata.xsd">
  <identifier identifierType="DOI">10.5281/zenodo.3752635</identifier>
  <creators>
    <creator>
      <creatorName>Aldaya, Alejandro Cabrera</creatorName>
      <givenName>Alejandro Cabrera</givenName>
      <familyName>Aldaya</familyName>
      <nameIdentifier nameIdentifierScheme="ORCID" schemeURI="http://orcid.org/">0000-0002-1544-6772</nameIdentifier>
      <affiliation>Tampere University</affiliation>
    </creator>
    <creator>
      <creatorName>Pereida Garcia, Cesar</creatorName>
      <givenName>Cesar</givenName>
      <familyName>Pereida Garcia</familyName>
      <nameIdentifier nameIdentifierScheme="ORCID" schemeURI="http://orcid.org/">0000-0001-6812-8498</nameIdentifier>
      <affiliation>Tampere University</affiliation>
    </creator>
    <creator>
      <creatorName>Brumley, Billy Bob</creatorName>
      <givenName>Billy Bob</givenName>
      <familyName>Brumley</familyName>
      <nameIdentifier nameIdentifierScheme="ORCID" schemeURI="http://orcid.org/">0000-0001-9160-0463</nameIdentifier>
      <affiliation>Tampere University</affiliation>
    </creator>
  </creators>
  <titles>
    <title>From A to Z: Projective coordinates leakage in the wild: research data and tooling</title>
  </titles>
  <publisher>Zenodo</publisher>
  <publicationYear>2020</publicationYear>
  <subjects>
    <subject>side-channel analysis</subject>
    <subject>ECDSA</subject>
    <subject>CVE-2020-11735</subject>
    <subject>CVE-2020-10932</subject>
    <subject>applied cryptography</subject>
    <subject>libgcrypt</subject>
    <subject>mbedTLS</subject>
    <subject>WolfSSL</subject>
  </subjects>
  <dates>
    <date dateType="Issued">2020-04-15</date>
  </dates>
  <resourceType resourceTypeGeneral="Dataset"/>
  <alternateIdentifiers>
    <alternateIdentifier alternateIdentifierType="url">https://zenodo.org/record/3752635</alternateIdentifier>
  </alternateIdentifiers>
  <relatedIdentifiers>
    <relatedIdentifier relatedIdentifierType="DOI" relationType="IsVersionOf">10.5281/zenodo.3752634</relatedIdentifier>
  </relatedIdentifiers>
  <version>1</version>
  <rightsList>
    <rights rightsURI="https://opensource.org/licenses/MIT">MIT License</rights>
    <rights rightsURI="info:eu-repo/semantics/openAccess">Open Access</rights>
  </rightsList>
  <descriptions>
    <description descriptionType="Abstract">&lt;p&gt;Description&lt;/p&gt;

&lt;p&gt;This dataset and software tool are for reproducing the research results related to CVE-2020-10932 and CVE-2020-11735, resulting from the article &amp;quot;From A to Z: Projective coordinates leakage in the wild&amp;quot; (to appear at CHES 2020). The data was used to carry out the attack in Section 6 of the article.&lt;/p&gt;

&lt;p&gt;Data format&lt;/p&gt;

&lt;p&gt;txt files&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;[int].txt&lt;/code&gt; files contain an encoded page-fault trace prefixed by &lt;code&gt;trace:&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;The encoding follows this table:&lt;/p&gt;

&lt;pre&gt;&lt;code class="language-markdown"&gt;| Functions              | Symbol | Page offset |
| ---------------------- |:------:|:-------:|
| _gcry_ecc_ecdsa_sign   |    T   | 0xa1000 |
| _gcry_mpi_invm         |    .   | 0xcf000 |
| _gcry_mpi_set          |    S   | 0xd5000 |
| _gcry_mpi_add          |    A   | 0xcd000 |
| _gcry_mpih_sub_n       |    -   | 0xd8000 |
| _gcry_mpih_rshift      |    -   | 0xd8000 |&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;code&gt;_gcry_ecc_ecdsa_sign&lt;/code&gt; is the highest level function tracked in the attack. This allows to differentiate different calls to the &lt;code&gt;_gcry_mpi_invm&lt;/code&gt; function which contains an insecure version of a Binary Extended Euclidean Algorithm (BEEA).&lt;/p&gt;

&lt;p&gt;Using these pages it is possible to locate the execution of &lt;code&gt;_gcry_mpi_invm&lt;/code&gt; corresponding to the computation of &lt;code&gt;Z mod p&lt;/code&gt; during projective to affine coordinates conversion (see &lt;code&gt;preprocess_trace&lt;/code&gt; function).&lt;/p&gt;

&lt;p&gt;It can be seen, that &lt;code&gt;_gcry_mpih_sub_n&lt;/code&gt; and &lt;code&gt;_gcry_mpih_rshift&lt;/code&gt; 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 &lt;code&gt;extract_Zi&lt;/code&gt; and &lt;code&gt;extract_Xi&lt;/code&gt; functions in &lt;code&gt;recover_z.py&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;dat files&lt;/p&gt;

&lt;p&gt;The format of the &lt;code&gt;[int].dat&lt;/code&gt; files is as follows.&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;&lt;code&gt;# X [hex]&lt;/code&gt;: Ground truth projective output of scalar multiplication, before affine conversion&lt;/li&gt;
	&lt;li&gt;&lt;code&gt;# Y [hex]&lt;/code&gt;: Ground truth projective output of scalar multiplication, before affine conversion&lt;/li&gt;
	&lt;li&gt;&lt;code&gt;# Z [hex]&lt;/code&gt;: Ground truth projective output of scalar multiplication, before affine conversion&lt;/li&gt;
	&lt;li&gt;&lt;code&gt;# curve_name [str]&lt;/code&gt;: The curve (P256)&lt;/li&gt;
	&lt;li&gt;&lt;code&gt;# h [hex]&lt;/code&gt;: Hash of the message to be signed&lt;/li&gt;
	&lt;li&gt;&lt;code&gt;# k [hex]&lt;/code&gt;: Ground truth ECDSA nonce&lt;/li&gt;
	&lt;li&gt;&lt;code&gt;# q [hex]&lt;/code&gt;: Curve order&lt;/li&gt;
	&lt;li&gt;&lt;code&gt;# r [hex]&lt;/code&gt;: First component of the ECDSA signature&lt;/li&gt;
	&lt;li&gt;&lt;code&gt;# s [hex]&lt;/code&gt;: Second component of the ECDSA signature&lt;/li&gt;
	&lt;li&gt;&lt;code&gt;# x [hex]&lt;/code&gt;: Ground truth ECDSA private key&lt;/li&gt;
	&lt;li&gt;&lt;code&gt;# y [hex] [hex]&lt;/code&gt;: Public key coordinates&lt;/li&gt;
	&lt;li&gt;&lt;code&gt;# leak_pad [int],[int],[int]&lt;/code&gt;: Leakage recovered during backtracking. Example: &lt;code&gt;0,4,15 =&amp;gt; 0 = k % 2**4 = k &amp;amp; 15&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Tooling&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;recover_z.py&lt;/code&gt; script&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Loads a trace.&lt;/li&gt;
	&lt;li&gt;Recovers the corresponding Z coordinate from the trace data.&lt;/li&gt;
	&lt;li&gt;verifies the recovered Z matches the ground truth Z.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example&lt;/p&gt;

&lt;p&gt;Unpack the data:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;tar xf traces.tar.gz&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Run the tooling on trace index 123:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ python2 recover_z.py 123
INFO:recovered Z:65b9b7006bc7b030218bef1b6e569f9f7acaee059b53d669388c6b860f67e213
INFO:     real Z:65b9b7006bc7b030218bef1b6e569f9f7acaee059b53d669388c6b860f67e213&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The output demonstrates the recovered Z coordinate is correct, i.e. matches the ground truth.&lt;/p&gt;

&lt;p&gt;Credits&lt;/p&gt;

&lt;p&gt;Authors&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Alejandro Cabrera Aldaya (Tampere University, Tampere, Finland)&lt;/li&gt;
	&lt;li&gt;Cesar Pereida Garc&amp;iacute;a (Tampere University, Tampere, Finland)&lt;/li&gt;
	&lt;li&gt;Billy Bob Brumley (Tampere University, Tampere, Finland)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Funding&lt;/p&gt;

&lt;p&gt;This project has received funding from the European Research Council (ERC) under the European Union&amp;rsquo;s Horizon 2020 research and innovation programme (grant agreement No 804476).&lt;/p&gt;

&lt;p&gt;License&lt;/p&gt;

&lt;p&gt;This project is distributed under MIT license.&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
  </descriptions>
  <fundingReferences>
    <fundingReference>
      <funderName>European Commission</funderName>
      <funderIdentifier funderIdentifierType="Crossref Funder ID">10.13039/501100000780</funderIdentifier>
      <awardNumber awardURI="info:eu-repo/grantAgreement/EC/H2020/804476/">804476</awardNumber>
      <awardTitle>Side-Channel Aware Engineering</awardTitle>
    </fundingReference>
  </fundingReferences>
</resource>
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