Data remanence in non-volatile semiconductor memories

25
1 Security Group Seminar William Gates Building, Cambridge, UK, 26 October 2004 Data remanence in non-volatile semiconductor memories Part I: Introduction and non-invasive approach Sergei Skorobogatov

Transcript of Data remanence in non-volatile semiconductor memories

Page 1: Data remanence in non-volatile semiconductor memories

1

Security Group Seminar William Gates Building, Cambridge, UK, 26 October 2004

Data remanence in non-volatile semiconductor memories

Part I: Introduction and non-invasive approach

Sergei Skorobogatov

Page 2: Data remanence in non-volatile semiconductor memories

2

Security Group Seminar William Gates Building, Cambridge, UK, 26 October 2004

Data remanence

� Magnetic media� SRAM and DRAM

� Low temperature data remanence� Long-term retention effects�Burning-in data

� Data retention�Connected to remanence�Specified by manufacturers

Page 3: Data remanence in non-volatile semiconductor memories

3

Security Group Seminar William Gates Building, Cambridge, UK, 26 October 2004

Data remanence in non-volatile memories

� EPROM, EEPROM and Flash� Floating-gate transistors, 103 - 105 �, �VTH = 3.5 V

� Levels� File system (erasing a file)� File backup (software features)�Smart memory (hardware buffers)�Memory array

� Possible threats�Resetting security protection in microcontrollers�Sharing EEPROM area between different

applications in smartcards

Page 4: Data remanence in non-volatile semiconductor memories

4

Security Group Seminar William Gates Building, Cambridge, UK, 26 October 2004

Non-volatile memories

� UV EPROM�Advantages

� Electrically programmable� Compact design (1T cell)

�Disadvantages� Long write time (>10 ms)� High voltages for programming� Very long erase time (>10 min) and UV light use� Not scalable below 0.35 �m (top metal layers)� High cost (quartz window in ceramic) or OTP� Low endurance (100 E/W cycles)� Short data retention (10 years)

Page 5: Data remanence in non-volatile semiconductor memories

5

Security Group Seminar William Gates Building, Cambridge, UK, 26 October 2004

Non-volatile memories

� EEPROM�Advantages

� Electrically programmable and erasable� Internal charge pumps in modern devices� High endurance (>100,000 E/W cycles)� Long data retention (>40 years)

�Disadvantages� Large cell size (2T cell)� Long write time (>1 ms) and erase time (>100 ms)� High voltages for programming (old designs)� High cost (low density)

Page 6: Data remanence in non-volatile semiconductor memories

6

Security Group Seminar William Gates Building, Cambridge, UK, 26 October 2004

Non-volatile memories

� Flash EEPROM�Advantages

�Electrically programmable and erasable� Internal charge pumps�Compact design (1T cell)�Fast write time (1 - 100 �s)�High endurance (>100,000 E/W cycles)�Long data retention (>100 years)�Low cost (compact design, 0.13 �m and smaller)

�Disadvantages�Erasing in blocks�Long erase time (>100 ms)

Page 7: Data remanence in non-volatile semiconductor memories

7

Security Group Seminar William Gates Building, Cambridge, UK, 26 October 2004

Structure of non-volatile memories

� UV EPROM EEPROM Flash EEPROM

Page 8: Data remanence in non-volatile semiconductor memories

8

Security Group Seminar William Gates Building, Cambridge, UK, 26 October 2004

Security in EPROM devices

� Security fuse location�Separate from main memory�Embedded in main memory

� Security monitoring�On reset or initialisation�Each time access is requested�Permanent

� Protection from UV light� Top metal layer� Fuses embedded in main memory

Page 9: Data remanence in non-volatile semiconductor memories

9

Security Group Seminar William Gates Building, Cambridge, UK, 26 October 2004

Security in EPROM devices

� Erasing with UV light�Memory and fuse are erased simultaneously�Memory is erased before the fuse

Page 10: Data remanence in non-volatile semiconductor memories

10

Security Group Seminar William Gates Building, Cambridge, UK, 26 October 2004

Security in EEPROM/Flash devices

� Security fuse location�Separate from main memory�Embedded in main memory

� Security monitoring�On reset or initialisation�Each time access was requested�Permanent

� Protection� Top metal layer from UV light� Inverted cells or non-sensitive to UV light�Passwords

Page 11: Data remanence in non-volatile semiconductor memories

11

Security Group Seminar William Gates Building, Cambridge, UK, 26 October 2004

Security in EEPROM/Flash devices

� Electrical erase� Fuse is erased before the memory�Memory and fuse are erased simultaneously�Memory is erased before the fuse

Page 12: Data remanence in non-volatile semiconductor memories

12

Security Group Seminar William Gates Building, Cambridge, UK, 26 October 2004

Attacks on EPROM devices

� Erasing with UV light�Memory and fuse are erased simultaneously

�VDD variation or power glitching�Read sense circuit: VTH = K VDD, K ~ 0.5

UV Erase of PIC12C509 (old revis ion)

0

1

2

3

4

5

6

7

0 2 4 6 8 10 12 14

Tim e, m in

VD

D, V

EPROM OK EPROM ERASED FUSE ERASED

Page 13: Data remanence in non-volatile semiconductor memories

13

Security Group Seminar William Gates Building, Cambridge, UK, 26 October 2004

Attacks on EPROM devices

� Erasing with UV light� Memory is erased before the fuse

�Cell charge alteration (controlled CHE injection)�External control over programming parameters

UV Erase of PIC12C509 (new revis ion)

0

1

2

3

4

5

6

7

0 2 4 6 8 10 12 14

Tim e, m in

VD

D, V

EPROM OK EPROM ERASED FUSE ERASED

Page 14: Data remanence in non-volatile semiconductor memories

14

Security Group Seminar William Gates Building, Cambridge, UK, 26 October 2004

Attacks on EEPROM/Flash devices

� Electrical erasing� Memory and fuse are erased simultaneously

� Fast process (difficult to control erasing)� VTH drops too low (power glitching does not work)� Internally stabilized power supply and voltage monitors� Cell charge alteration does not work

� Internal charge pumps and timing control� Fowler-Nordheim tunneling or fast CHE injection

Electrical Erase of MSP430F112

0

0.5

1

1.5

2

2.5

3

3.5

4

4.5

0 200 400 600 800 1000 1200 1400 1600

Time, us

VD

D, V

FLASH OK FLASH ERASED

Page 15: Data remanence in non-volatile semiconductor memories

15

Security Group Seminar William Gates Building, Cambridge, UK, 26 October 2004

Attacks on EEPROM/Flash devices

� Electrical erasing�Memory is erased before the fuse

�Five times excess in PIC16F84A�q = q0 e -t/τ, τ = 5 �s : 105 �� 1 - 2 ��Standard erase cycle = 10 ms

Electrical Erase of PIC16F84A

0

1

2

3

4

5

6

7

0 20 40 60 80 100 120 140

Time, us

VD

D, V

FLASH OK FLASH ERASED FUSE

Page 16: Data remanence in non-volatile semiconductor memories

16

Security Group Seminar William Gates Building, Cambridge, UK, 26 October 2004

Experimental part

� Test whether it is possible to measure VTH close to 0 V

� Test whether any significant residual charge is left after normal erase operation

� Test whether it is possible to distinguish between never-programmed and programmed cells

� Work out suggestions and countermeasures if necessary

Page 17: Data remanence in non-volatile semiconductor memories

17

Security Group Seminar William Gates Building, Cambridge, UK, 26 October 2004

Experimental part

� Data remanence evaluation in PIC16F84A� 100 �V precision power supply� 1 �s timing control

Page 18: Data remanence in non-volatile semiconductor memories

18

Security Group Seminar William Gates Building, Cambridge, UK, 26 October 2004

Measuring VTH close to 0 V in PIC16F84A

� Using power glitching technique�Reducing Vref to 0.5 V

� Exploiting after-erase discharging bug�Accidentally discovered 5 years ago�Shifts VTH up by 0.6 - 0.9 V

� Applying both techniques simultaneously�VTH = K VDD – VW

�VTH = −0.4 - 2.0 V

Page 19: Data remanence in non-volatile semiconductor memories

19

Security Group Seminar William Gates Building, Cambridge, UK, 26 October 2004

Test residual charge after erase

� VTH = Vref = K VDD – VW, K = 0.5, VW = 0.7 V� Memory bulk erase cycles (5V, 10 ms)

� Flash memory, 100 cycles: �VTH = 100 mV� EEPROM memory, 10 cycles: �VTH = 1 mV

Threshold Voltage Change During Erase Cycles

0

0.1

0.2

0.3

0.4

0.5

0.6

0 100 200 300 400 500 600

Number of Erase Cycles

VT

H, V

Programmed Fully Erased

Page 20: Data remanence in non-volatile semiconductor memories

20

Security Group Seminar William Gates Building, Cambridge, UK, 26 October 2004

Recovering data from erased PIC16F84A

� Large difference in VTH between cells in the array� Reference to the cell itself after an extra erase cycle

Threshold Voltage Distribution

0.35

0.4

0.45

0.5

0.55

0.6

0 7 14 21 28

Memory Address

VT

H, V

First Erase Second Erase

Page 21: Data remanence in non-volatile semiconductor memories

21

Security Group Seminar William Gates Building, Cambridge, UK, 26 October 2004

Never-programmed and programmed cells

� PIC16F84A comes programmed to all 0’s� 10,000 erase cycles and 10 hrs at 150˚C� Program all 0’s, then 10,000 erase cycles

� Still noticeable change of VTH = 40 mV

Threshold Voltage Distribution

-0.1

-0.05

0

0.05

0.1

0.15

0 7 14 21 28

Memory Address

VT

H, V

First Erase Second Erase

Page 22: Data remanence in non-volatile semiconductor memories

22

Security Group Seminar William Gates Building, Cambridge, UK, 26 October 2004

Programming cells before erasing

� No successfully recovered information from PIC16F84A if it was programmed with all 0’s before the erase operation

� Used as a standard in some Flash and EEPROM devices� Intel ETOX Flash memory (P28F010)�Microchip KeeLoq HCS200

Page 23: Data remanence in non-volatile semiconductor memories

23

Security Group Seminar William Gates Building, Cambridge, UK, 26 October 2004

Countermeasures

� Cycle EEPROM/Flash 10 – 100 times with random data before writing anything sensitive to them

� Program all EEPROM/Flash cells before erasing them� Remember about too intelligent memories,

backup/temporary files and file systems� Remember that memory devices are identical within

the same family� everything which is valid for PIC16F84A will work for

PIC16F627/628, PIC16F870/871/872 and PIC16F873/874/876/877� Use latest high-density devices which benefit from

newest technologies� Using encryption helps make data recovery more

difficult

Page 24: Data remanence in non-volatile semiconductor memories

24

Security Group Seminar William Gates Building, Cambridge, UK, 26 October 2004

Further research

� Back to the subtitle of this talk� Part I: Introduction and non-invasive approach� Good for security – less than 5% of memory devices are

susceptible to non-invasive attack discussed in this talk

� Semi-invasive approach� Measuring changes inside memory transistors� Influence on cell characteristics� To be Part II

� Invasive approach� Modifying the read sense circuit of the memory� Direct connection to the internal memory lines� To be Part III

Page 25: Data remanence in non-volatile semiconductor memories

25

Security Group Seminar William Gates Building, Cambridge, UK, 26 October 2004

Conclusions

� Floating-gate memories (EPROM, EEPROM and Flash) have data remanence problems

� Information from some samples can be recovered even after 100 erase cycles

� Even if the residual charge cannot be detected with existing methods it might be possible in the future with new technologies

� Secure devices should be tested for any possible outcomes of data remanence effect