Tribler / tribler

Privacy enhanced BitTorrent client with P2P content discovery
https://www.tribler.org
GNU General Public License v3.0
4.73k stars 445 forks source link

Open hardware-based and patent-free Physical Unclonable Function (PUF) #3064

Closed synctext closed 3 years ago

synctext commented 6 years ago

PUF technology is an emerging technology to store the essential part of a self-sovereign identity, the private key, in a tamper-proof manner. The private key is storage becomes volatile by using PUF technology [Patents].

Good intro:

Commercial product with SRAM PUF. Notes on how to use this feature

For TUDelft publication on PUF technology: "Modeling SRAM start-up behavior for physical unclonable functions". Lots more by Said Hamdioui plus Haji Akhundov. More Delft reports:

The popular 6Ts SRAM cell (see Fig. 2(a)) consists of two cross-coupled CMOS inverters formed by four transistors (Q 1 with Q5 and Q2 with Q6) and two pass transistors (Q3 and Q4). The pass transistors are used to access the cell for read and write operations. The bitline (BL), the compliment bitline (BLB) and the wordline (WL) are used to access the cell.

image

We simulate the start-up behavior of an SRAM cell using SPICE and BSIM4 65nm models. Process variation PDF for 65nm : image

Boris Škorić from Eindhoven has published work in this field:

Open Source Sandia National Laboratories PUF Analysis Tool

Please find related PUF software and articles for next meeting.

asajim commented 6 years ago
synctext commented 6 years ago

using standard PC board, "Investigating SRAM PUFs in large CPUs and GPUs" with code listings: https://arxiv.org/pdf/1507.08514.pdf DDR3: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4168438/ https://users.wpi.edu/~martin/MQP/edwardsetal.pdf

asajim commented 6 years ago

Note:

2 main parts of PUF

Ri <- PUF(Ci) : a response Ri is generated when challenging a PUF with a challenge Ci

Two distance measures of PUFs

  1. inter distance: distance between applying a challenge to two different PUFs
  2. intra distance: distance between applying a challenge twice to a PUF

Type of PUFs based on design

screen shot 2017-09-05 at 16 45 05

Type of PUFs based on number CRPs

Property of PUF

Technique to reduce noise

Application

asajim commented 6 years ago

Extra readings:

synctext commented 6 years ago

We have various Raspberry Pi model B+ 1.2 hardware. This enables quick and dirty prototyping, possibly even using the Python language :-) image image Goal: obtain SRAM chips and build the first completely patent-free functional PUF. Entropy and efficiency are not yet important. Key goal is raw uninitialized memory readout: image

synctext commented 6 years ago

First operational prototype! @hakhundov thnx for the help Solid progress within this master thesis project, it only started a few weeks ago. 20170921_101036 Hardware: Arduino microcontroller board based on the ATmega2560 and the attached 1 Mbit Serial SRAM device, a 23LC1024 by Microchip

void Spi23LC1024Read32(uint32_t address, uint8_t cs_pin, uint8_t* buff)
{
  uint32_t i; 
  uint8_t read_page; 

  digitalWrite(cs_pin, LOW);  
  SPI.transfer(READ);
  SPI.transfer((uint8_t)(address >> 16));
  SPI.transfer((uint8_t)(address >> 8)); 
  SPI.transfer((uint8_t)address);

  for (i = 0; i < 32; i++)
  {
      read_page = SPI.transfer(0x00);
      buff[i] = read_page;
//      Serial.println(read_page);
  }
  digitalWrite(cs_pin, HIGH);   
}

The skeleton open source repo for dumping the raw uninitialized memory using SPI. Next steps:

synctext commented 6 years ago

Possibly focus on the unstable bit plots of your hardware (see related work with 1432 repeats in their experiment).

asajim commented 6 years ago

Screenshot of some initialized bit from SRAM 23LC1024

screen shot 2017-10-10 at 11 38 58
asajim commented 6 years ago

Analysis result of 10 SRAMs 23LC1024:

Summary

asajim commented 6 years ago

Analysis result of 10 SRAMs 23K256:

Summary

asajim commented 6 years ago

Result of PUF trial using repetition code as ECC

key length: 128 bit

key:       01010111001100110100000101010001       00101011011110000110110001010001       01110011010000110100011101101011       01000001011001110011110100111101

base file for comparison: ascii-coded binary file 171017B/1.c

Algorithm for PUF using repetition code

  1. generate/read key (128 bits)
  2. produce a repetition of the key (here, repetition length is 16, 64 or 128) (128 bits x 128/64/16 repetition = 16k / 8k / 2k bits)
  3. first bits (16k / 8k / 2k bits) of the base file are XORed with repetition of bit key to produce helper data.
  4. helper data is XOR with bit from the destination file.
  5. decode repetition encoding (vote the majority of the result of previous step to reconstruct the key).
  6. compare the reconstructed key with the actual key

Result:

hakhundov commented 6 years ago

@asajim is the 'difference' between the reconstructed key and the actual key?

asajim commented 6 years ago

@hakhundov yes it is.

hakhundov commented 6 years ago

@asajim roughly speaking, it seems that the noise in the subsequent PUF measurements is way too big from seeing the results. A 100% difference would mean that there are >= 31 errors in every codeword (rep(64) case). Hence the fractional hamming distance between the reference and subsequent measurement must be at least 0.5. This is just an unreliable PUF. Btw, I don't see this noise in the tables above (profiling). I might be wrong of course.

asajim commented 6 years ago

@hakhundov I think I haven't explained my data clearly. One folder refers to a single chip with 10 measurements. Folder 171017A refers to chip A, and measurement was performed on Oct 17th, 2017. Different folders refer to different chips, but with the same type. If I understand correctly, '100% difference between two chips' means it is a correct PUF. In rep(64), the one that's not acceptable is when a different chip produce the same key (difference = 0%, e.g. 171017A produce the same key with the base file 171017B). In rep(16), only chip B that produce the same as the base file (measurement 1 on folder 171017B). It would also be unacceptable if PUF measurements on the same chip produce difference key.

asajim commented 6 years ago

Trial of implementing BCH

Index Trial 2 Trial 3 Trial 4 Trial 5 Trial 6 Trial 7 Trial 8 Trial 9 Trial 10
1 9.3933 11.1546 8.0235 8.6106 6.8493 9.3933 8.4149 10.1761 8.6106
2 8.6106 10.9589 1.5656 4.6967 6.2622 8.4149 4.6967 6.2622 9.7847
3 7.045 5.0881 5.0881 3.5225 3.1311 6.8493 4.3053 9.3933 8.0235
4 11.3503 9.589 6.4579 11.1546 9.3933 7.6321 11.3503 7.4364 18.9824
5 5.4795 6.0665 6.0665 5.8708 4.1096 6.6536 4.6967 4.3053 9.9804
6 4.1096 6.4579 4.501 7.2407 2.9354 7.6321 7.045 4.501 7.6321
7 5.2838 9.9804 6.2622 9.3933 7.8278 6.4579 7.2407 8.4149 6.8493
8 7.045 8.2192 1.3699 3.9139 4.501 7.6321 4.1096 7.2407 3.9139
9 3.5225 5.6751 0.3914 6.8493 4.1096 3.5225 3.5225 3.9139 4.6967
10 5.2838 5.0881 6.4579 4.6967 8.2192 7.6321 8.2192 7.8278 3.7182
11 9.3933 18.0039 9.3933 7.2407 10.1761 14.4814 9.9804 10.5675 14.6771
12 7.4364 9.1977 10.3718 3.1311 8.8063 6.0665 5.8708 6.2622 5.0881
13 4.6967 5.2838 6.2622 7.045 7.2407 3.7182 6.2622 6.8493 5.8708
14 12.9159 13.3072 8.8063 12.1331 9.589 14.09 6.2622 11.3503 10.9589
15 9.9804 8.0235 7.8278 8.4149 4.501 8.2192 4.1096 9.1977 6.6536
16 8.2192 11.546 7.045 5.2838 6.8493 4.6967 4.6967 8.0235 3.7182
17 7.045 8.2192 6.0665 4.6967 4.8924 3.9139 4.6967 6.4579 7.2407
18 7.2407 3.7182 4.6967 4.6967 0.7828 7.045 3.7182 6.6536 5.2838
19 5.0881 3.1311 3.1311 5.2838 2.9354 5.4795 6.4579 9.1977 4.501
20 6.0665 11.7417 3.3268 10.1761 4.8924 8.2192 4.501 12.9159 5.8708
21 8.6106 6.6536 2.9354 9.589 2.7397 5.4795 6.4579 7.045 4.3053
22 5.8708 9.1977 5.2838 6.2622 9.002 5.8708 6.6536 6.4579 7.4364
23 9.3933 8.4149 7.2407 1.1742 7.4364 4.6967 9.1977 4.8924 7.6321
24 3.5225 6.4579 1.5656 3.7182 1.7613 3.3268 2.3483 1.3699 3.1311
25 0.5871 9.7847 3.1311 3.3268 10.1761 2.7397 9.9804 9.589 8.6106
26 9.589 11.9374 8.2192 9.3933 10.1761 4.501 8.6106 5.6751 8.2192
27 7.045 9.9804 5.2838 8.4149 4.1096 3.5225 4.8924 9.9804 5.2838
28 4.8924 2.544 3.1311 3.7182 4.1096 4.8924 2.9354 5.2838 3.3268
29 3.7182 3.3268 2.3483 1.9569 5.4795 6.8493 3.1311 4.1096 3.5225
30 3.3268 4.3053 2.9354 3.7182 2.3483 3.3268 6.0665 2.544 2.7397
31 6.2622 2.9354 0.9785 5.8708 5.2838 5.8708 6.0665 8.0235 4.3053
32 9.589 8.6106 6.2622 8.6106 8.2192 8.8063 12.5245 10.5675 12.3288
33 9.9804 1.7613 9.3933 5.2838 7.8278 5.6751 6.0665 7.8278 7.2407
34 6.0665 9.1977 3.3268 6.4579 9.1977 5.0881 10.1761 6.6536 6.2622
35 5.2838 5.2838 2.1526 7.6321 6.2622 5.0881 8.4149 7.045 5.4795
36 4.1096 4.1096 4.501 2.3483 3.5225 4.1096 4.3053 4.6967 7.2407
37 4.1096 5.6751 6.8493 8.2192 7.045 8.4149 5.4795 6.6536 9.002
38 7.045 5.0881 3.3268 7.4364 2.7397 9.7847 5.8708 5.0881 3.9139
39 7.4364 5.8708 3.5225 3.9139 1.9569 3.9139 4.3053 4.501 1.3699
40 8.8063 13.3072 8.2192 9.1977 2.7397 9.7847 7.8278 8.4149 11.546
41 2.3483 9.002 1.3699 3.5225 1.5656 6.4579 3.5225 5.2838 2.1526
42 8.4149 7.4364 8.2192 7.045 2.544 5.8708 9.002 4.501 6.6536
43 7.8278 10.7632 6.8493 8.4149 9.3933 10.7632 10.1761 7.4364 8.4149
44 3.9139 9.3933 9.002 9.1977 6.8493 8.2192 12.1331 6.6536 11.3503
45 5.4795 8.0235 5.6751 4.8924 7.2407 3.9139 10.3718 10.1761 9.3933
46 3.9139 8.4149 4.501 4.8924 10.1761 2.544 7.2407 7.8278 8.6106
47 1.5656 2.1526 1.3699 1.7613 1.7613 3.7182 2.3483 3.9139 2.3483
48 3.5225 6.4579 1.9569 5.4795 7.8278 4.3053 3.1311 4.3053 5.2838
49 6.8493 7.045 9.9804 4.501 6.6536 5.2838 2.544 6.2622 3.1311
50 6.0665 9.9804 2.7397 5.8708 11.546 9.7847 8.2192 5.0881 6.8493
51 3.9139 13.8943 6.4579 10.1761 6.2622 7.8278 10.9589 3.1311 10.7632
52 5.8708 7.4364 4.1096 5.8708 7.6321 5.0881 4.501 4.6967 6.4579
53 6.8493 9.1977 8.4149 9.3933 8.2192 12.5245 3.3268 11.1546 11.9374
54 10.9589 8.0235 10.9589 10.1761 9.1977 12.5245 6.6536 11.546 8.4149
55 5.2838 5.4795 10.3718 3.9139 4.8924 7.045 9.589 10.3718 8.0235
56 4.3053 6.6536 2.9354 8.2192 4.6967 3.1311 5.8708 8.2192 6.0665
57 5.6751 8.4149 4.1096 10.9589 7.6321 6.6536 4.8924 12.9159 6.0665
58 5.8708 3.5225 2.9354 4.501 0.7828 3.9139 4.1096 5.0881 1.7613
59 8.4149 9.002 3.9139 5.0881 8.2192 4.3053 6.0665 8.0235 3.1311
60 3.1311 5.0881 6.6536 1.5656 3.7182 5.6751 2.1526 5.8708 1.9569
61 1.7613 7.4364 3.5225 3.7182 3.3268 4.3053 7.2407 6.8493 5.2838
62 12.3288 16.047 13.3072 10.3718 15.4599 13.6986 9.9804 13.8943 16.2427
63 10.7632 6.6536 1.3699 4.8924 6.0665 12.3288 6.2622 7.6321 9.7847
64 3.3268 5.8708 3.9139 6.0665 2.7397 5.8708 1.5656 7.4364 3.3268
65 5.0881 1.9569 5.6751 3.3268 7.6321 4.8924 6.0665 6.6536 4.8924
66 11.546 5.4795 5.0881 6.6536 7.4364 7.045 14.8728 5.4795 9.3933
synctext commented 6 years ago

PUF starts to become usable! 19 chips in total, 9 of type 23K256 not that good (e.g. 34% error rate), 8 out of 10 from 23LC1024 type usable. ("23K256 show more unreliable result compared to 23LC1024") 19_puf_chips_setup

asajim commented 6 years ago

Result on 18 23LC1024 SRAMs

Mean Average Hamming Distance Per 511 Bits on 33726 Bits (%) Maximum Hamming Distance Per 511 Bits on 33726 Bits ()
A 0.7043 7.6834 20.3523
B 0.6588 6.899 22.5049
C 0.6791 5.0173 17.8082
D 0.6731 5.0667 14.6771
E 0.669 5.8144 15.4599
F 0.6714 6.1634 16.8297
G 0.6573 5.0985 13.8943
H 0.6716 4.9489 14.6771
I 0.6786 4.9849 15.0685
J 0.6638 5.1019 13.6986
K 0.6809 6.7253 20.7436
L 0.6677 5.1019 16.6341
M 0.6645 6.3726 16.2427
N 0.6756 5.0129 11.9374
O 0.6733 4.9302 14.4814
P 0.6677 5.2771 15.6556
Q 0.6743 6.7998 18.7867
R 0.6738 5.1741 15.4599
S 0.6699 5.0530 14.0900
T 0.6890 5.6327 13.8943
U 0.6772 5.3263 14.8728
V 0.6683 5.1357 16.6341
W 0.6783 5.4622 14.8728
synctext commented 6 years ago
synctext commented 6 years ago

Progress:

asajim commented 6 years ago

Novel profiling methodology, published in 2017 :

synctext commented 6 years ago

Status:

asajim commented 6 years ago

Problem Statement

Implement an open source key storage system using SRAM-PUF scheme, where the SRAM is general purpose SRAM available on the market.

Steps:

  1. investigate the characteristic of SRAM PUF types
  2. search and analyse existing secure key storage method using SRAM PUF
  3. design a scheme to enable secure PUF key storage using off-the-shelf SRAM
  4. propose a system that will be able to store key, which consists of software and hardware components
  5. evaluate the solution by constructing the system, experimenting and conducting performance analysis
    1. investigate hardware that suitable for the scheme
    2. profile SRAMs to look for stable bits
    3. choose an efficient error correcting code and determine its parameter to fit the SRAM
    4. construct the complete software, which contained the error correcting code and combine it with hardware
  6. explore possible improvements on the system for a future research

Main contribution

Scheme for storing 7 bits key

puf-5-2

asajim commented 6 years ago

Complete scheme for storing 256 bits key

complete

asajim commented 6 years ago

Method for looking stable bits in 23LC1024:

synctext commented 6 years ago

Progress feedback:

asajim commented 6 years ago

Possible improvement:

Critical points:

privacy amplification: a process that allows two parties to distill a secret key from a common random variable about which an eavesdropper has partial information (cited from Generalized Privacy Amplification). in PUF that used for generating a key, privacy amplification usually done by applying a hash function on a chunk of SRAM bits

asajim commented 6 years ago

Current progress on SRAM 23LC1024:

Current method on determine the stable bits (3 stages):

Result:

Current progress on CY62256N SRAM:

synctext commented 6 years ago

Voltage level control from software? Great progress. Congrats. Can you do slow increase and fast turnon of voltage and effect on stability? Please make a list of potential experiments to run fir a week.

asajim commented 6 years ago

Current experiment:

Next experiment:

Possible related authentication protocols:

synctext commented 6 years ago

Status update:

ToDo: From weak PUF to strong PUF.

Please write the first thesis chapter and 2-ish pages of measurement resutls.

asajim commented 6 years ago

First thesis draft: thesis-2.pdf

synctext commented 6 years ago

ToDo: focus on strong authentication, state-of-the-art protocols, open source code, HMAC, Bitcoin ECC, Secp256k1, etc.

asajim commented 6 years ago

Revision 2 - Thesis Draft

Notes:

synctext commented 6 years ago

Introduction chapter storyline remarks:

Chapter 2 : "Introduction to Security"

Problem description chapter:

Security analysis: loss of PUF hardware, loss of password, loss of both, etc.

General comments:

Typos:

asajim commented 6 years ago

Latest draft: thesis.pdf

synctext commented 6 years ago
synctext commented 6 years ago

we would like a fully operational PUF of your design and development environment in our lab. redo the Bitcoin experiment.

asajim commented 6 years ago

Thesis draft:

thesis.pdf

synctext commented 6 years ago

Please provide @qstokkink with 4 out of your 5 operational SRAM puf chips. Three Arduino + interface board plus sources to get it operational and profile each PUF bit. Allows us to do parallel profiling. Additional microSDcard for storage of helper data + adapter to interface with Arduino.

synctext commented 6 years ago
asajim commented 6 years ago

Latest draft: thesis.pdf

synctext commented 6 years ago

sell your stuff even more, like this in abstract: As the grand concluding experiment of this thesis we store the private key of a Bitcoin with the physical security protection of our PUF.

asajim commented 6 years ago

Final thesis report: thesis.pdf

Thesis repository : software-based-PUF

@synctext I think the issue title should be changed into "Open software-based and patent-free Physical Unclonable Function (PUF) " not "Open hardware-based and patent-free Physical Unclonable Function (PUF) "

synctext commented 6 years ago

Congrats on your TUDelft master degree! Official thesis .pdf download repo: https://repository.tudelft.nl/islandora/object/uuid%3A4f879ecf-95d5-4482-8931-8c40abde0e79 "Open-Source Software-Based SRAM-PUF for Secure Data and Key Storage Using Off-The-Shelf SRAM"

nymble commented 5 years ago

What makes this patent free?
The technologies as described have numerous patents that cover the SRAM-PUF mechanisms.

synctext commented 5 years ago

What makes this patent free? The technologies as described have numerous patents that cover the SRAM-PUF mechanisms.

@nymble Good point. We have not yet done a thorough prior work. This thesis is build upon early scientific papers and early work by Delft ourselves. The 2003 patents describe systems like "During an enrollment phase, Alice 16 issues a challenge C to source P 20 and receives a response A from source P 20". Our approach avoids this with "store this given private key generation seed".

manasviaudichya311 commented 4 years ago

how the generated secret key and seed for the random number are stored inside the secure storage of sram? Is the secret key ever stored inside in the sram or it is generated everytime we need to encrypt or decrypt anything?

synctext commented 4 years ago

@rahulsharma311 This is a stand-alone implementation for research purposes.

Is the secret key ever stored inside in the sram

The secret key is generated from physical properties upon startup. As stated above, "the private key is storage becomes volatile by using PUF". There is no secure sram storage, the PUF is designed to be airgapped and challenge/response interfaced as an isolated component. In a decade this could become a standard component within a smartphone to achieve passport-grade digital identity.

synctext commented 3 years ago

New master students always welcome. This project has been without an active master student for a while. Closing this issue until a new person can work on this.