29
Data Encryption Data Encryption Chris Mraovich Chris Mraovich

Data Encryption Chris Mraovich. Overview Purpose of EncryptionPurpose of Encryption Permutations Bases and FactoradicsPermutations Bases and Factoradics

Embed Size (px)

Citation preview

Data EncryptionData Encryption

Chris MraovichChris Mraovich

OverviewOverview

•Purpose of EncryptionPurpose of Encryption

•Permutations Bases and Factoradics Permutations Bases and Factoradics

•Project SummaryProject Summary

Purpose of EncryptionPurpose of Encryption

Protecting Digital ContentProtecting Digital Content

•DVDs use CSS (Content Scramble System)DVDs use CSS (Content Scramble System)

•Weak Algorithm -Cracked by Jon Johansen in 1999

Protecting Digital ContentProtecting Digital Content

•Uses encryption on program ROM chipsUses encryption on program ROM chips

Arcade Printed Circuit BoardsArcade Printed Circuit Boards

•Capcom Play System 2 (CPS2)Capcom Play System 2 (CPS2)

-Used in mid 1990s for 2D games-Used in mid 1990s for 2D games

•Graphic ROM chips are not encryptedGraphic ROM chips are not encrypted

•Cracked byCracked by team team

Protecting Digital ContentProtecting Digital ContentWhy use encryption on an arcade board?Why use encryption on an arcade board?

1.1. ROM chips can be copied to a PC as binary dataROM chips can be copied to a PC as binary data

2. Program can be written to interpret binary data2. Program can be written to interpret binary data

3. PC can then run the arcade without the board3. PC can then run the arcade without the board

Permutations, Bases, and Permutations, Bases, and FactoradicsFactoradics

PermutationsPermutationsGoal is to rearrange bits into a different patternGoal is to rearrange bits into a different pattern

1 0 1 1

1 1 0 1

Permutation – rearrangement of a set of objectsPermutation – rearrangement of a set of objects

Original Form:Original Form:

Encrypted Form:Encrypted Form:

Factoradic – mixed radix numbering system thatFactoradic – mixed radix numbering system thatuses multiple bases to represent auses multiple bases to represent asingle numbersingle number

Bases and FactoradicsBases and Factoradics

•Factoradics provide a way of generating permutationsFactoradics provide a way of generating permutationsWhy are they important?Why are they important?

Generate Factoradic

Obtain permutation

from factoradic

Use permutation to rearrange

bits

Summary of Encryption ProcessSummary of Encryption Process

Order & Total Permutations Order & Total Permutations

Suppose there are 4 objectsSuppose there are 4 objects

Order – number of objects (N)Order – number of objects (N)

Total number of permutations for N objects is N!Total number of permutations for N objects is N!

N = 4, so there are 4! or 24 ways to rearrange 4 objectsN = 4, so there are 4! or 24 ways to rearrange 4 objects

00 { 0 0 0 0 } { 0 0 0 0 } ( 0 1 2 3 ) ( 0 1 2 3 )1 1 { 0 0 1 0 } { 0 0 1 0 } ( 0 1 3 2 ) ( 0 1 3 2 )2 2 { 0 1 0 0 } { 0 1 0 0 } ( 0 2 1 3 ) ( 0 2 1 3 )3 3 { 0 1 1 0 } { 0 1 1 0 } ( 0 2 3 1 ) ( 0 2 3 1 )4 4 { 0 2 0 0 } { 0 2 0 0 } ( 0 3 1 2 ) ( 0 3 1 2 )5 5 { 0 2 1 0 } { 0 2 1 0 } ( 0 3 2 1 ) ( 0 3 2 1 )6 6 { 1 0 0 0 } { 1 0 0 0 } ( 1 0 2 3 ) ( 1 0 2 3 )7 7 { 1 0 1 0 } { 1 0 1 0 } ( 1 0 3 2 ) ( 1 0 3 2 )88 { 1 1 0 0 } { 1 1 0 0 } ( 1 2 0 3 ) ( 1 2 0 3 )99 { 1 1 1 0 } { 1 1 1 0 } ( 1 2 3 0 ) ( 1 2 3 0 )10 10 { 1 2 0 0 } { 1 2 0 0 } ( 1 3 0 2 ) ( 1 3 0 2 )11 11 { 1 2 1 0 } { 1 2 1 0 } ( 1 3 2 0 ) ( 1 3 2 0 )12 12 { 2 0 0 0 } { 2 0 0 0 } ( 2 0 1 3 ) ( 2 0 1 3 )13 13 { 2 0 1 0 } { 2 0 1 0 } ( 2 0 3 1 ) ( 2 0 3 1 )14 14 { 2 1 0 0 } { 2 1 0 0 } ( 2 1 0 3 ) ( 2 1 0 3 )15 15 { 2 1 1 0 } { 2 1 1 0 } ( 2 1 3 0 ) ( 2 1 3 0 )16 16 { 2 2 0 0 } { 2 2 0 0 } ( 2 3 0 1 ) ( 2 3 0 1 )17 17 { 2 2 1 0 } { 2 2 1 0 } ( 2 3 1 0 ) ( 2 3 1 0 )18 18 { 3 0 0 0 } { 3 0 0 0 } ( 3 0 1 2 ) ( 3 0 1 2 )19 19 { 3 0 1 0 } { 3 0 1 0 } ( 3 0 2 1 ) ( 3 0 2 1 )20 { 3 1 0 0 } ( 3 1 0 2 )21 21 { 3 1 1 0 } { 3 1 1 0 } ( 3 1 2 0 ) ( 3 1 2 0 )22 22 { 3 2 0 0 } { 3 2 0 0 } ( 3 2 0 1 ) ( 3 2 0 1 )23 23 { 3 2 1 0 } { 3 2 1 0 } ( 3 2 1 0 ) ( 3 2 1 0 )

•Each factoradic uniquely Each factoradic uniquely identifies a particular permutationidentifies a particular permutation

Total Permutations of order 4Total Permutations of order 4FactoradicFactoradic PermutationPermutationIntInt

•Int is the base 10 representation Int is the base 10 representation of the factoradicof the factoradic

•Walkthrough of how 20Walkthrough of how 201010 is is

converted to a permutation of converted to a permutation of order 4order 4

Bases – Generate FactoradicBases – Generate Factoradic

Write 20Write 2010 10 in Base 2in Base 2

24 23 22 21 20

(16) (8) (4) (2) (1)

1 0 1 0 0

Expand the Binary NumberExpand the Binary Number

((12 x x 24) + () + (02 x x 23) + () + (12 x x 22) + () + (02 x x 21) + () + (02 x x 20) = 20) = 201010

Base 10 Base 2 Multi-Base Factoradic

20 10100 3100

From Base 2 to FactoradicFrom Base 2 to Factoradic

((E2 x x 24) + () + (D2 x x 23) + () + (C2 x x 22) + () + (B2 x x 21) + () + (A2 x x 20))

Factoradic ExpansionFactoradic Expansion

A2, B2, C2, D2, E2 are all numbers in base 2 (0 or 1) are all numbers in base 2 (0 or 1)2n are powers of 2

((E5 x x 4!) + () + (D4 x x 3!) + () + (C3 x x 2!) + () + (B2 x x 1!) + () + (A1 x x 0!))

2n n!

The bases of The bases of A2, B2, C2, D2, E2

increase from right to leftincrease from right to left

Generalization of Base 2 ExpansionGeneralization of Base 2 Expansion

What Changes :What Changes :1.)1.)

2.)2.)

……

……

(Mixed Radix - multiple bases used)(Mixed Radix - multiple bases used)

Factoradic Number SystemFactoradic Number SystemFactoradic ExpansionFactoradic Expansion

((E5 x x 4!) + () + (D4 x x 3!) + () + (C3 x x 2!) + () + (B2 x x 1!) + () + (A1 x x 0!))

Simplify FactorialsSimplify Factorials

((E5 x x 24) + () + (D4 x x 6) + () + (C3 x x 2) + () + (B2 x x 1) + () + (A1 x x 1))

000001111

22233

4

Since Since A, , B, , C, , D, and , and E have different bases, they have have different bases, they have different ranges of valid valuesdifferent ranges of valid values

……

((E5 x x 24) + () + (D4 x x 6) + () + (C3 x x 2) + () + (B2 x x 1) + () + (A1 x x 1))

000001111

22233

4

Factoradic Number SystemFactoradic Number SystemWrite 20Write 2010 10 in Factoradic notationin Factoradic notation

((3 x x 6) + () + (1 x x 2) + () + (0 x x 1) + () + (0 x x 1) = 20) = 20((3 x x 3!) + () + (1 x x 2!) + () + (0 x x 1!) + () + (0 x x 0!) =) =

Final Factoradic for 20Final Factoradic for 201010: : 3 1 0 0

Obtain Permutation from Obtain Permutation from FactoradicFactoradic

Initial Factoradic: Initial Factoradic: 3 1 0 0

Initial Factoradic: Initial Factoradic: 3 1 0 0

1) Increment every digit by 11) Increment every digit by 1 4 2 1 1

Obtain Permutation from Obtain Permutation from FactoradicFactoradic

Initial Factoradic: Initial Factoradic: 3 1 0 0

1) Increment every digit by 11) Increment every digit by 1 4 2 1 1

2) Replace right-most digit with a 12) Replace right-most digit with a 1 4 2 1 1

Obtain Permutation from Obtain Permutation from FactoradicFactoradic

Initial Factoradic: Initial Factoradic: 3 1 0 0

1) Increment every digit by 11) Increment every digit by 1 4 2 1 1

2) Replace right-most digit with a 12) Replace right-most digit with a 1 4 2 1 11

3)This 3)This 1 is the “new value” (N) is the “new value” (N)

If any red value to the right of N is If any red value to the right of N is >= N, it gets incremented by 1>= N, it gets incremented by 1

1

Obtain Permutation from Obtain Permutation from FactoradicFactoradic

Initial Factoradic: Initial Factoradic: 3 1 0 0

1) Increment every digit by 11) Increment every digit by 1 4 2 1 1

2) Replace right-most digit with a 12) Replace right-most digit with a 1 4 2 1 1

213)This 3)This 1 is the “new value” (N) is the “new value” (N)

If any red value to the right of N is If any red value to the right of N is >= N, it gets incremented by 1>= N, it gets incremented by 1

Obtain Permutation from Obtain Permutation from FactoradicFactoradic

Initial Factoradic: Initial Factoradic: 3 1 0 0

1) Increment every digit by 11) Increment every digit by 1 4 2 1 1

2) Replace right-most digit with a 12) Replace right-most digit with a 1 4 2 1 1

213)This 3)This 1 is the “new value” (N) is the “new value” (N)

If any red value to the right of N is If any red value to the right of N is >= N, it gets incremented by 1>= N, it gets incremented by 1

4) Repeat step 3 until all red 4) Repeat step 3 until all red numbers have been usednumbers have been used

21

2

Obtain Permutation from Obtain Permutation from FactoradicFactoradic

Initial Factoradic: Initial Factoradic: 3 1 0 0

1) Increment every digit by 11) Increment every digit by 1 4 2 1 1

2) Replace right-most digit with a 12) Replace right-most digit with a 1 4 2 1 1

213)This 3)This 1 is the “new value” (N) is the “new value” (N)

If any red value to the right of N is If any red value to the right of N is >= N, it gets incremented by 1>= N, it gets incremented by 1

4) Repeat step 3 until all red 4) Repeat step 3 until all red numbers have been usednumbers have been used

312

4

312

Obtain Permutation from Obtain Permutation from FactoradicFactoradic

Initial Factoradic: Initial Factoradic: 3 1 0 0

1) Increment every digit by 11) Increment every digit by 1 4 2 1 1

2) Replace right-most digit with a 12) Replace right-most digit with a 1 4 2 1 1

213)This 3)This 1 is the “new value” (N) is the “new value” (N)

If any red value to the right of N is If any red value to the right of N is >= N, it gets incremented by 1>= N, it gets incremented by 1

4) Repeat step 3 until all red 4) Repeat step 3 until all red numbers have been usednumbers have been used

312

4 312

4) Decrement all numbers by 14) Decrement all numbers by 1 3 1 0 2

Obtain Permutation from Obtain Permutation from FactoradicFactoradic

3 1 0 2

Original Binary Data:Original Binary Data:

Use Permutation to swap bitsUse Permutation to swap bitsObtained Permutation:Obtained Permutation:

1 0 1 01 0 1 0

Encrypted Bit Array Data:Encrypted Bit Array Data:

00 11 22 33

3 1 0 2

Original Binary Data:Original Binary Data:

Use Permutation to swap bitsUse Permutation to swap bitsObtained Permutation:Obtained Permutation:

1 0 1 01 0 1 0

Encrypted Bit Array Data:Encrypted Bit Array Data:

11

00 11 22 33

3 1 0 2

Original Binary Data:Original Binary Data:

Use Permutation to swap bitsUse Permutation to swap bitsObtained Permutation:Obtained Permutation:

1 0 1 01 0 1 0

Encrypted Bit Array Data:Encrypted Bit Array Data:

1100

00 11 22 33

3 1 0 2

Original Binary Data:Original Binary Data:

Use Permutation to swap bitsUse Permutation to swap bitsObtained Permutation:Obtained Permutation:

1 0 1 01 0 1 0

Encrypted Bit Array Data:Encrypted Bit Array Data:

110011

00 11 22 33

3 1 0 2

Original Binary Data:Original Binary Data:

Use Permutation to swap bitsUse Permutation to swap bitsObtained Permutation:Obtained Permutation:

1 0 1 01 0 1 0

Encrypted Bit Array Data:Encrypted Bit Array Data:

110011 00

00 11 22 33

Project SummaryProject Summary

•Encrypt/Decrypt any binary file on theEncrypt/Decrypt any binary file on theWindows platformWindows platform

•Generate keys to decrypt filesGenerate keys to decrypt filesLike a really long password stored in a text fileLike a really long password stored in a text file

Use the principles of factoradics to:Use the principles of factoradics to: