Stephen Drape. Oxford University Computing Laboratory. with thanks to Jeff Sanders



Similar documents
The countdown problem

α = u v. In other words, Orthogonal Projection

Specifying Imperative Data Obfuscations

Methods for Finding Bases

is in plane V. However, it may be more convenient to introduce a plane coordinate system in V.

( ) which must be a vector

Linear Codes. Chapter Basics

Math Circle Beginners Group October 18, 2015

Obfuscation of Abstract Data-Types

Orthogonal Projections

Functional Programming

160 CHAPTER 4. VECTOR SPACES

Section 5.3. Section 5.3. u m ] l jj. = l jj u j + + l mj u m. v j = [ u 1 u j. l mj

NOTES ON LINEAR TRANSFORMATIONS

Abstract Data Type. EECS 281: Data Structures and Algorithms. The Foundation: Data Structures and Abstract Data Types

Problem Set 5 Due: In class Thursday, Oct. 18 Late papers will be accepted until 1:00 PM Friday.

MATH 304 Linear Algebra Lecture 18: Rank and nullity of a matrix.

December 4, 2013 MATH 171 BASIC LINEAR ALGEBRA B. KITCHENS

THE DIMENSION OF A VECTOR SPACE

Lecture 15 An Arithmetic Circuit Lowerbound and Flows in Graphs

Advanced compiler construction. General course information. Teacher & assistant. Course goals. Evaluation. Grading scheme. Michel Schinz

Chapter 6. Orthogonality

Question 2: How do you solve a matrix equation using the matrix inverse?

Network (Tree) Topology Inference Based on Prüfer Sequence

Recall that two vectors in are perpendicular or orthogonal provided that their dot

1.2 Solving a System of Linear Equations

7.1 Our Current Model

Please follow these guidelines when preparing your answers:

Continued Fractions and the Euclidean Algorithm

A binary search tree or BST is a binary tree that is either empty or in which the data element of each node has a key, and:

Lectures notes on orthogonal matrices (with exercises) Linear Algebra II - Spring 2004 by D. Klain

Similar matrices and Jordan form

Row Echelon Form and Reduced Row Echelon Form

MATH10212 Linear Algebra. Systems of Linear Equations. Definition. An n-dimensional vector is a row or a column of n numbers (or letters): a 1.

Modeling and Performance Evaluation of Computer Systems Security Operation 1

It has a parameter list Account(String n, double b) in the creation of an instance of this class.

Eigenvalues, Eigenvectors, Matrix Factoring, and Principal Components

Zabin Visram Room CS115 CS126 Searching. Binary Search

Factorization Theorems

CHAPTER 4 ESSENTIAL DATA STRUCTRURES

V. Adamchik 1. Graph Theory. Victor Adamchik. Fall of 2005

IE 680 Special Topics in Production Systems: Networks, Routing and Logistics*

The Advantages and Disadvantages of Network Computing Nodes

The Technology Behind a Graphical User Interface for an Equational Reasoning Assistant

4.5 Linear Dependence and Linear Independence

[Refer Slide Time: 05:10]

Data Structures Fibonacci Heaps, Amortized Analysis

3 Orthogonal Vectors and Matrices

DATA OBFUSCATION. What is data obfuscation?

6. Cholesky factorization

Mathematics Course 111: Algebra I Part IV: Vector Spaces

AN ALGORITHM FOR DETERMINING WHETHER A GIVEN BINARY MATROID IS GRAPHIC

Lecture 1: Introduction

6.042/18.062J Mathematics for Computer Science. Expected Value I

Static Analysis of Virtualization- Obfuscated Binaries

8 Square matrices continued: Determinants

Direct Methods for Solving Linear Systems. Matrix Factorization

Computer Science Information Sheet for entry in What is Computer Science?

Math 312 Homework 1 Solutions

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS. + + x 2. x n. a 11 a 12 a 1n b 1 a 21 a 22 a 2n b 2 a 31 a 32 a 3n b 3. a m1 a m2 a mn b m

Problems and Measures Regarding Waste 1 Management and 3R Era of public health improvement Situation subsequent to the Meiji Restoration

7. LU factorization. factor-solve method. LU factorization. solving Ax = b with A nonsingular. the inverse of a nonsingular matrix

Chapter 13. Disk Storage, Basic File Structures, and Hashing

Matrix Differentiation

How To Create A Tree From A Tree In Runtime (For A Tree)

Vector Spaces 4.4 Spanning and Independence

Lecture 12: Software protection techniques. Software piracy protection Protection against reverse engineering of software

root node level: internal node edge leaf node Data Structures & Algorithms McQuain

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS

CS3220 Lecture Notes: QR factorization and orthogonal transformations

Lecture 3: Finding integer solutions to systems of linear equations

SHARP BOUNDS FOR THE SUM OF THE SQUARES OF THE DEGREES OF A GRAPH

Lecture 5 Principal Minors and the Hessian

FUZZY CLUSTERING ANALYSIS OF DATA MINING: APPLICATION TO AN ACCIDENT MINING SYSTEM

AUTOMATED TEST GENERATION FOR SOFTWARE COMPONENTS

Datatype-generic data migrations

Matrix Representations of Linear Transformations and Changes of Coordinates

CS2Bh: Current Technologies. Introduction to XML and Relational Databases. Introduction to Databases. Why databases? Why not use XML?

Systems of Linear Equations

5. Orthogonal matrices

9 MATRICES AND TRANSFORMATIONS

Chapter 13. Chapter Outline. Disk Storage, Basic File Structures, and Hashing

Boogie: A Modular Reusable Verifier for Object-Oriented Programs

OPTIMAl PREMIUM CONTROl IN A NON-liFE INSURANCE BUSINESS

Notes on Factoring. MA 206 Kurt Bryan

2. Basic Relational Data Model

Unit Storage Structures 1. Storage Structures. Unit 4.3

GROUP ALGEBRAS. ANDREI YAFAEV

Merkle Hash Trees for Distributed Audit Logs

1 Introduction to Matrices

2. (a) Explain the strassen s matrix multiplication. (b) Write deletion algorithm, of Binary search tree. [8+8]

Applied Linear Algebra I Review page 1

Alok Gupta. Dmitry Zhdanov

Introduction to Software Testing Chapter 8.1 Building Testing Tools Instrumentation. Chapter 8 Outline

Section Continued

Software Protection through Code Obfuscation

Transcription:

Stephen Drape Oxford University Computing Laboratory with thanks to Jeff Sanders

Obfuscation is a program transformation: Used to make a program "harder to understand" Try to make reverse engineering harder Must preserve functionality Concerns about efficiency

Obfuscation is usually applied to objectoriented languages such as Java and C#. When compiling these languages, an intermediate representation is produced. It is possible to recover the original code from this representation obfuscation can make this process harder.

Instead of obfuscating an imperative program, we consider obfuscating operations of a data-type we can then exploit properties of that data-type (see later!). We model the data-types and the operations in Haskell.

! We want to obfuscate some set operations. Using functional programs, we can: Derive obfuscations Easily establish proofs of correctness Both of these are difficult to do in imperative languages.

# $ Adapt "array splitting" consider a particular example "alternating split" Write xs ~ l,r a to denote xs is split into two lists l and r xs is data refined by l,r a [5,7,5,4,3,1,1] ~ [5,5,3,1], [7,4,1] a Invariant: r l r +1 "

$ split([ ]) = [ ],[ ] a split([p]) = [p],[ ] a split(p:q:xs) = p:l, q:r a where l, r a = split(xs) unsplit [ ], [ ] a = [ ] unsplit [p], [ ] a unsplit p:l, q:r a = = [p] p:q:unsplit(l, r a ) %

split. op = sp_op. split Data Refinement sp_op = split. op. unsplit op = unsplit. sp_op. split &

# p: l, r a =p:r, l a l 0, r 0 a ++ l 1, r 1 a l 0 == r 0 = l 0 ++ l 1, r 0 ++ r 1 a otherwise = l 0 ++ r 1, r 0 ++ l 1 a : and ++ distribute over split '

)# * $ member p xs = or(map (==p) xs) insert p xs = if member p xs then xs else p:xs delete p xs = ys ++ (if null zs then zs else tail zs) where (ys,zs) = span (/=p) xs (

$ Deriving the delete operation for split lists delete a p = split.delete p.unsplit Let l = [l 0, l 1,, l j, l j+1,,l n ] r = [r 0, r 1,,r n' ] and xs ~ l,r a We have three cases (a) p l (b) p r (c) p l, r a

+,-,p l) Suppose that l j = p Let (ly,lz) = span (/=p) l = ([l 0, l 1,, l j-1 ], [l j, l j+1,, l n ]) (ry,rz) = splitat ly r = ([r 0, r 1,, r j-1 ], [r j,, r n' ])

+,-,p l) delete a pl, r a = {derivation equation} split(delete p (unsplitl, r a )) ={definition of unsplit} split(delete p [l 0, r 0, l 1, ]) ={definition of delete, l j =p} split([l 0, r 0,..., r j-1 ] ++ [r j, ])

+,-,p l) split([l 0, r 0,..., r j-1 ] ++ [r j, ]) ={split distributes over ++} split([l 0, r 0,...])++ split([r j, ]) ={definition of split} [l 0, ], [r 0, ] a ++ [r j,, r n' ], [l j+1,, l n ] a ={earlier definitions} ly, ry a ++ rz, tail lz a

+,-,p l) ly, ry a ++ rz, tail lz a ={definition of ++, ly = ry } ly ++ rz, ry ++ tail lz a We cannot simplify this further, but as lists are unordered: ly, ry a is equivalent to ry, ly a

+,-,p l) ry, ly a ++ rz, tail lz a ={definition of ++} ry ++ rz, ly ++ tail lz a ={definitions} r, delete p l a "

+,-,p r) delete a pl, r a = { l =(head l):(tail l), l [ ]} delete a p(head l): (tail l), r a ={definition of :} delete a p ((head l): r, tail l a ) ={head l p} (head l):(delete a p r, tail l a ) %

+,-,p r) (head l):(delete a p r, tail l a ) = {previous definition of delete a } (head l):(tail l, delete p r a ) ={definition of :} (head l):(delete p r),tail l a &

$ (c) p l and p r delete a pl, r a = l, r a Final definition delete a pl, r a member p l = r, delete p l a member p r = (head l):(delete p r), tail l a otherwise = l, r a '

. insert a pl, r a = if member a pl, r a thenl, r a elsep:r, l a We will now prove that insert p = unsplit. (insert a p). split (

! Case for p xs is trivial. Otherwise, suppose that: xs ~ l, r a and p xs unsplit(insert a p split(xs)) ={xs ~ l, r a } unsplit(insert a p (l, r a ))

! unsplit(insert a p (l, r a )) ={definition of insert a } unsplit(p:r, l a ) ={definition of :} unsplit(p:l, r a ) ={property of :} p:unsplit(l, r a )

! p:unsplit(l, r a ) ={xs ~ l, r a } p:xs ={definition of insert} insert p xs

+/$0 delete p xs = ys ++ (if null zs then zs else tail zs) where (ys,zs) = span ( p) xs delete a pl, r a member p l = r, delete p l a member p r = (head l):(delete p r), tail l a otherwise = l, r a Both functions have linear complexity.

+/$0 insert p xs = if member p xs then xs else p:xs insert a p l, r a = if member a p l, r a thenl, r a elsep:r, l a Again, these functions have linear complexity.

1 1 The paper looks at three representations: Unordered with duplicates Unordered without duplicates Strictly-increasing Proofs and derivations of delete and insert are given for the other representations. Also, another split is considered. "

2 At the beginning, it was stated we obfuscate data-types directly so that we can exploit properties of the data-type. Suppose that we want to split a matrix and we want to develop a transpose operation for the split matrix. Suppose we flatten the matrix to an array and then split this array. %

& 2 Using arrays means that we lose the "shape" of the matrix and so we have difficulty in constructing a transpose operation. Using matrices directly: = T T T T T D B C A D C B A

+$ We have seen that using data-types and functional programming, we can derive obfuscations prove correctness Our operations make little change to the complexity Have to keep split secret '

3 Possible areas for future work Other obfuscations Other data-types (matrices, trees) Automation Obfuscation definition (