real time image encryption with rsa algorithmpeople.bu.edu/tyyang/rsa.pdfboston university slideshow...

30
Real Time Image Encryption with RSA Algorithm RSA Group Final Presentation Date: 4/30/2014

Upload: duongnhan

Post on 09-Mar-2018

227 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Real Time Image Encryption with RSA Algorithmpeople.bu.edu/tyyang/RSA.pdfBoston University Slideshow Title Goes Here Real Time Image Encryption with RSA Algorithm 17 9/19/14 PUTTING

Real Time Image Encryption with

RSA Algorithm RSA Group

Final Presentation Date: 4/30/2014

Page 2: Real Time Image Encryption with RSA Algorithmpeople.bu.edu/tyyang/RSA.pdfBoston University Slideshow Title Goes Here Real Time Image Encryption with RSA Algorithm 17 9/19/14 PUTTING

Boston University Slideshow Title Goes Here

Real Time Image Encryption with RSA Algorithm

2

9/19/14

Team Members

§  Jing Zheng §  Abantika Ghosh §  Akash Kadakia §  Tianyu Yang §  Sumeet Sharma

Page 3: Real Time Image Encryption with RSA Algorithmpeople.bu.edu/tyyang/RSA.pdfBoston University Slideshow Title Goes Here Real Time Image Encryption with RSA Algorithm 17 9/19/14 PUTTING

Boston University Slideshow Title Goes Here

Real Time Image Encryption with RSA Algorithm

3

9/19/14

Page 4: Real Time Image Encryption with RSA Algorithmpeople.bu.edu/tyyang/RSA.pdfBoston University Slideshow Title Goes Here Real Time Image Encryption with RSA Algorithm 17 9/19/14 PUTTING

Boston University Slideshow Title Goes Here

Real Time Image Encryption with RSA Algorithm

4

9/19/14

BASIC FUNCTIONALITY

Milestone 1 Milestone 2

Page 5: Real Time Image Encryption with RSA Algorithmpeople.bu.edu/tyyang/RSA.pdfBoston University Slideshow Title Goes Here Real Time Image Encryption with RSA Algorithm 17 9/19/14 PUTTING

Boston University Slideshow Title Goes Here

Real Time Image Encryption with RSA Algorithm

5

9/19/14

RSA ALGORITHM KEY GENERATION

•  PUBLIC KEY 1: N=P*Q will be calculated.

•  PUBLIC KEY 2: Calculate Euler’s Totient Z=(P-1)*(Q-1). Choose any number e such that 1 < e < Z and e is coprime to Z.

•  PRIVATE KEY:

ENCRYPTION

d.e=1(modφ(n)))  

DECRYPTION

•  c=m^e (mod n)

•  m=c^d (mod n)

Page 6: Real Time Image Encryption with RSA Algorithmpeople.bu.edu/tyyang/RSA.pdfBoston University Slideshow Title Goes Here Real Time Image Encryption with RSA Algorithm 17 9/19/14 PUTTING

Boston University Slideshow Title Goes Here

Real Time Image Encryption with RSA Algorithm

6

9/19/14

VERILOG STRUCTURE

MODULE GEN_KEY

MODULE ENCRYPTION

MODULE

DECRYPTION

MODULE DIVISION

MODULE POWER

MODULE MOD

PUB_KEY1

PUB_KEY1

PUB_KEY2

PRI_KEY

𝑐= 𝑚↑𝑒 (mod  n)

𝑚= c↑𝑑 (mod  n)

PRI_KEY

PUB_KEY2

Page 7: Real Time Image Encryption with RSA Algorithmpeople.bu.edu/tyyang/RSA.pdfBoston University Slideshow Title Goes Here Real Time Image Encryption with RSA Algorithm 17 9/19/14 PUTTING

Boston University Slideshow Title Goes Here

Real Time Image Encryption with RSA Algorithm

7

9/19/14

MODULE GEN_KEY INPUTS •  CLOCK •  RESET •  P (prime no.1) •  Q (prime no.2) OUTPUTS •  PUBLIC KEY 1 •  PUBLIC KEY 2 •  PRIVATE KEY •  READY

Behavior simulation result of GEN_KEY

Page 8: Real Time Image Encryption with RSA Algorithmpeople.bu.edu/tyyang/RSA.pdfBoston University Slideshow Title Goes Here Real Time Image Encryption with RSA Algorithm 17 9/19/14 PUTTING

Boston University Slideshow Title Goes Here

Real Time Image Encryption with RSA Algorithm

8

9/19/14

SUB MODULES GEN_KEY

Page 9: Real Time Image Encryption with RSA Algorithmpeople.bu.edu/tyyang/RSA.pdfBoston University Slideshow Title Goes Here Real Time Image Encryption with RSA Algorithm 17 9/19/14 PUTTING

Boston University Slideshow Title Goes Here

Real Time Image Encryption with RSA Algorithm

9

9/19/14

MODULE ENCRYPTION INPUTS •  CLK,RST,ENABLE •  DATA_IN •  PUBLIC KEY 1 •  PUBLIC KEY 2 •  PRIVATE KEY

OUTPUTS •  DATA_OUT •  READY Behavior simulation result of Encryption

Page 10: Real Time Image Encryption with RSA Algorithmpeople.bu.edu/tyyang/RSA.pdfBoston University Slideshow Title Goes Here Real Time Image Encryption with RSA Algorithm 17 9/19/14 PUTTING

Boston University Slideshow Title Goes Here

Real Time Image Encryption with RSA Algorithm

10

9/19/14

MODULE DECRYPTION INPUTS •  CLK,RST,ENABLE •  DATA_IN •  PUBLIC KEY 1 •  PUBLIC KEY 2 •  PRIVATE KEY

OUTPUTS •  DATA_OUT •  READY Behavior simulation result of Decryption

Page 11: Real Time Image Encryption with RSA Algorithmpeople.bu.edu/tyyang/RSA.pdfBoston University Slideshow Title Goes Here Real Time Image Encryption with RSA Algorithm 17 9/19/14 PUTTING

Boston University Slideshow Title Goes Here

Real Time Image Encryption with RSA Algorithm

11

9/19/14

SUB MODULES ENCRYPTION

Page 12: Real Time Image Encryption with RSA Algorithmpeople.bu.edu/tyyang/RSA.pdfBoston University Slideshow Title Goes Here Real Time Image Encryption with RSA Algorithm 17 9/19/14 PUTTING

Boston University Slideshow Title Goes Here

Real Time Image Encryption with RSA Algorithm

12

9/19/14

MODULE POWER INPUTS •  CLOCK,RESET •  BASE •  EXPONENT

OUTPUTS •  DATA_OUT •  READY

Behavior simulation result of Power Function

Page 13: Real Time Image Encryption with RSA Algorithmpeople.bu.edu/tyyang/RSA.pdfBoston University Slideshow Title Goes Here Real Time Image Encryption with RSA Algorithm 17 9/19/14 PUTTING

Boston University Slideshow Title Goes Here

Real Time Image Encryption with RSA Algorithm

13

9/19/14

SUB MODULES POWER

Page 14: Real Time Image Encryption with RSA Algorithmpeople.bu.edu/tyyang/RSA.pdfBoston University Slideshow Title Goes Here Real Time Image Encryption with RSA Algorithm 17 9/19/14 PUTTING

Boston University Slideshow Title Goes Here

Real Time Image Encryption with RSA Algorithm

14

9/19/14

MODULE MOD INPUTS •  CLOCK,RESET •  DIVIDEND •  DIVIDER

OUTPUTS •  DATA_OUT •  READY

Behavior simulation result of MODULUS

Page 15: Real Time Image Encryption with RSA Algorithmpeople.bu.edu/tyyang/RSA.pdfBoston University Slideshow Title Goes Here Real Time Image Encryption with RSA Algorithm 17 9/19/14 PUTTING

Boston University Slideshow Title Goes Here

Real Time Image Encryption with RSA Algorithm

15

9/19/14

SUB MODULES MOD

Page 16: Real Time Image Encryption with RSA Algorithmpeople.bu.edu/tyyang/RSA.pdfBoston University Slideshow Title Goes Here Real Time Image Encryption with RSA Algorithm 17 9/19/14 PUTTING

Boston University Slideshow Title Goes Here

Real Time Image Encryption with RSA Algorithm

16

9/19/14

MODULE DIV INPUTS •  CLOCK,RESET •  DIVIDEND •  DIVIDER

OUTPUTS •  QUOTIENT •  REMAINDER •  READY Behavior simulation result of DIVIDE

Page 17: Real Time Image Encryption with RSA Algorithmpeople.bu.edu/tyyang/RSA.pdfBoston University Slideshow Title Goes Here Real Time Image Encryption with RSA Algorithm 17 9/19/14 PUTTING

Boston University Slideshow Title Goes Here

Real Time Image Encryption with RSA Algorithm

17

9/19/14

PUTTING IT ALL TOGETHER

•  All the sub-modules were tested individually. •  The input data vector is loaded into the top module from a .txt file. •  The test bench stores the output in another .txt file. •  To test our design we input all numbers from 0 to 15. •  The input and output text file consist of an image stored in binary

format. •  This is done using two functions in MATLAB to convert an image into

it’s binary equivalent and vice-versa. •  One function converts the image into binary from and acts as the input

which is then encrypted. •  Another function converts the decrypted text output into an image.

Page 18: Real Time Image Encryption with RSA Algorithmpeople.bu.edu/tyyang/RSA.pdfBoston University Slideshow Title Goes Here Real Time Image Encryption with RSA Algorithm 17 9/19/14 PUTTING

Boston University Slideshow Title Goes Here

Matlab functions

00000110 00000100 00000100 00001010 00010010 00100100 00100010 10010110 10101010 00101101 11001000 00101001

; ; ;

Trustees Presentation

18

9/19/14

Function: Image2Data

Function: Data2Image

Page 19: Real Time Image Encryption with RSA Algorithmpeople.bu.edu/tyyang/RSA.pdfBoston University Slideshow Title Goes Here Real Time Image Encryption with RSA Algorithm 17 9/19/14 PUTTING

Boston University Slideshow Title Goes Here

Real Time Image Encryption with RSA Algorithm

19

9/19/14

MODULE RSA ENCRYPTION INPUTS •  CLOCK,RESET •  ENABLE •  DATA_IN •  P •  Q

OUTPUTS •  READY •  DATA_OUT

Behavior simulation result of RSA ENCRYPTION

Page 20: Real Time Image Encryption with RSA Algorithmpeople.bu.edu/tyyang/RSA.pdfBoston University Slideshow Title Goes Here Real Time Image Encryption with RSA Algorithm 17 9/19/14 PUTTING

Boston University Slideshow Title Goes Here

Real Time Image Encryption with RSA Algorithm

20

9/19/14

MODULE RSA DECRYPTION INPUTS •  CLOCK,RESET •  ENABLE •  DATA_IN •  P •  Q

OUTPUTS •  READY •  DATA_OUT

Behavior simulation result of RSA DECRYPTION

Page 21: Real Time Image Encryption with RSA Algorithmpeople.bu.edu/tyyang/RSA.pdfBoston University Slideshow Title Goes Here Real Time Image Encryption with RSA Algorithm 17 9/19/14 PUTTING

Boston University Slideshow Title Goes Here

Real Time Image Encryption with RSA Algorithm

21

9/19/14

RESULT

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

0 1 8 24 13 11 39 31 2 15 37 29 6 4 44 9

DATA IN ENCRYPTED DATA DECRYPTED DATA

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Page 22: Real Time Image Encryption with RSA Algorithmpeople.bu.edu/tyyang/RSA.pdfBoston University Slideshow Title Goes Here Real Time Image Encryption with RSA Algorithm 17 9/19/14 PUTTING

Boston University Slideshow Title Goes Here

Real Time Image Encryption with RSA Algorithm

22

9/19/14

RSA CHIP GRAPH

Page 23: Real Time Image Encryption with RSA Algorithmpeople.bu.edu/tyyang/RSA.pdfBoston University Slideshow Title Goes Here Real Time Image Encryption with RSA Algorithm 17 9/19/14 PUTTING

Boston University Slideshow Title Goes Here

Real Time Image Encryption with RSA Algorithm

23

9/19/14

POST-ROUTE CLOCK TREE

Page 24: Real Time Image Encryption with RSA Algorithmpeople.bu.edu/tyyang/RSA.pdfBoston University Slideshow Title Goes Here Real Time Image Encryption with RSA Algorithm 17 9/19/14 PUTTING

Boston University Slideshow Title Goes Here

Real Time Image Encryption with RSA Algorithm

24

9/19/14

CLOCK TREE WITH DELAY

Page 25: Real Time Image Encryption with RSA Algorithmpeople.bu.edu/tyyang/RSA.pdfBoston University Slideshow Title Goes Here Real Time Image Encryption with RSA Algorithm 17 9/19/14 PUTTING

Boston University Slideshow Title Goes Here

Real Time Image Encryption with RSA Algorithm

25

9/19/14

CLOCK TREE WITH DELAY

Page 26: Real Time Image Encryption with RSA Algorithmpeople.bu.edu/tyyang/RSA.pdfBoston University Slideshow Title Goes Here Real Time Image Encryption with RSA Algorithm 17 9/19/14 PUTTING

Boston University Slideshow Title Goes Here

Real Time Image Encryption with RSA Algorithm

26

9/19/14

CLOCK TREE MIN MAX DELAY

Page 27: Real Time Image Encryption with RSA Algorithmpeople.bu.edu/tyyang/RSA.pdfBoston University Slideshow Title Goes Here Real Time Image Encryption with RSA Algorithm 17 9/19/14 PUTTING

Boston University Slideshow Title Goes Here

Real Time Image Encryption with RSA Algorithm

27

9/19/14

CHIP LAYOUT

Chip size :

145.725 um * 144.185 um

Page 28: Real Time Image Encryption with RSA Algorithmpeople.bu.edu/tyyang/RSA.pdfBoston University Slideshow Title Goes Here Real Time Image Encryption with RSA Algorithm 17 9/19/14 PUTTING

Boston University Slideshow Title Goes Here

Real Time Image Encryption with RSA Algorithm

28

9/19/14

PERFORMANCE ANALYSIS

Critical Path

Other end arrival time 0.245

Setup 0.292

Phase Shift 20

Required time 19.953

Arrival Time 19.772

Slack Time 0.181

Clock Rise Edge 0.000

Clock Network Latency(Pro) 0.272

Begin point Arrival Time 0.272 ������

Critical path of the Design

Page 29: Real Time Image Encryption with RSA Algorithmpeople.bu.edu/tyyang/RSA.pdfBoston University Slideshow Title Goes Here Real Time Image Encryption with RSA Algorithm 17 9/19/14 PUTTING

Boston University Slideshow Title Goes Here

Real Time Image Encryption with RSA Algorithm

29

9/19/14

CHALLENGES FACED

•  Calculating the modulus of equal values was giving erroneous results. This bug was later fixed.

•  Very long time to process a number as big as 255.

•  Small glitch in the divide module during synthesis.

•  And of course, the NANGATE Library.

Page 30: Real Time Image Encryption with RSA Algorithmpeople.bu.edu/tyyang/RSA.pdfBoston University Slideshow Title Goes Here Real Time Image Encryption with RSA Algorithm 17 9/19/14 PUTTING

Boston University Slideshow Title Goes Here

Real Time Image Encryption with RSA Algorithm

30

9/19/14