software protection
DESCRIPTION
Software protection. Mariano Ceccato FBK - Fondazione Bruno Kessler [email protected]. Traditional computer security. Most computer security research: Protect the integrity of a benign host (and its data) from attacks by malicious client programs Basis of the Java security model - PowerPoint PPT PresentationTRANSCRIPT
18/03/2007 Obfuscation 1
Software protection
Mariano Ceccato
FBK - Fondazione Bruno Kessler
18/03/2007 Obfuscation 2
Traditional computer security
Most computer security research: Protect the integrity of a benign host (and its data) from attacks by malicious client
programs Basis of the Java security model
Downloaded applet or virus infested application Restrict the actions that the client is allowed to perform
Software isolation A program is not able to write outside of a designated area (sandbox)
18/03/2007 Obfuscation 3
More recent computer security
Interest in mobile agents changed the view of computer security Benign client code being threatened by host on which it has downloaded/installed
Defend a client is much more difficult than defend a host. To defend the host all is needed is to restrict the client Once the client code is in the host, the host can use any technique to violate its integrity.
Software piracy Reverse Engineering Software tampering
4
Problem 1:Malicious Reverse Engineering
Valuable piece of code is extracted from an application and incorporated into competitor’s code.
18/03/2007 Obfuscation 5
Problem 2:Software piracy
Illegal copy ad resale of applications 12 billion $ per year, major concern for everyone who sells
software Solution used in the past:
Dongle (it is weak and it annoys customers)
18/03/2007 Obfuscation 6
Problem 3:Software tampering
E-commerce application programs contain encryption keys or other secret information. Pirates who are able to extract, modify, or otherwise tamper with this information can incur significant financial losses to the intellectual property owner.
7
Problem 1:Malicious Reverse Engineering
Valuable piece of code is extracted from an application and incorporated into competitor’s code.
8
Scenario
Customer Charles
Pirate Bob
Author Alice
IP
Pro
gram
Social ToolsAdvertising
Legal ToolsDMCA
TechnologicalTools
ObfuscationWatermarking
Tamperproofing
18/03/2007 Obfuscation 9
IP In A Program
public class Fibonacci {Hashtable memo = new Hashtable();public int fib ( int n ) {
if ( !memo.contains(n) )if ( n <= 2 )
memo.put(n,1);else
memo.put(n, fib( n - 1 ) + fib( n - 2 ));return memo.get(n);
}
10
Obfuscation
Obfuscation transforms a program into a new program which: Has the same semantics Is harder to reverse engineer
18/03/2007 Obfuscation 11
Example
public class Fibonacci {
public int fib ( int n ) {if ( n <= 2 )
return 1;else
return fib( n - 1 ) + fib( n - 2 );}
}
18/03/2007 Obfuscation 12
Example: Obfuscation
public class x {public int x ( int x ) {
return x <=2 ? 1 : x(x-1)+x(x-2);}}
18/03/2007 Obfuscation 13
Problem 2:Software piracy
Illegal copy ad resale of applications 12 billion $ per year, major concern for everyone who sells
software Solution used in the past:
Dongle (it is weak and it annoys customers)
14
Watermarking
ID
Watermarking transforms a program into a new program which: Has the same semantics Contains some additional robust identifier
18/03/2007 Obfuscation 15
Watermarking
18/03/2007 Obfuscation 16
Example: Watermarking
public class Fibonacci {String watermark = “Authored by Alice”;public int fibonacci ( int n ) {
if ( false )println ( “Authored by Alice” );
if ( n<=2 ) return 1;
else return fib ( n - 1 ) + fib ( n - 2 );
}
18/03/2007 Obfuscation 17
Example: Watermarking
public class Fibonacci {
public int fib ( int n ) {if ( opaque predicate )
println ( “Authored by Alice” );if ( n<=2 )
return 1;else
return fib ( n - 1 ) + fib ( n - 2 );}
18/03/2007 Obfuscation 18
Watermarking
Embed a structure W into a program p such that: W is easy to locate and extract from P Embedding W in P does not affect performances (cheap) Embedding W does not change statistical properties of P (static/dynamic
stealth) W has a mathematical property that allow to argue that its presence in P is the
result of a deliberate action (e.g. product of two prime numbers)
18/03/2007 Obfuscation 19
Additive attack:
Add a second watermark to program P. Attack is effective if it is impossible to recover
temporal precedence between watermarks.
18/03/2007 Obfuscation 20
Distortive attack:
applying semantic-preserving transformations such that: W can not be recognized P is still useful for the attacker
18/03/2007 Obfuscation 21
Collusive attack:
Attacker buys sever copy of program P, each one with a different fingerprint.
By comparing the different copy of P, fingerprint is located Fingerprint can removed/modified
18/03/2007 Obfuscation 22
Problem 3:Software tampering
E-commerce application programs contain encryption keys or other secret information. Pirates who are able to extract, modify, or otherwise tamper with this information can incur significant financial losses to the intellectual property owner.
23
Tamper-proofing
trigger
Tamper-proofing transforms a program into a new program which:
Has the same semantics on expected input “Explodes” on when even slightly modified or on unexpected input
18/03/2007 Obfuscation 24
Example: Tamper-proofing
public class Fibonacci {public int fibonacci ( int n ) {
String encrypted = “0x10 0x21 0x11 0xa2 0x22 0x91 0x21 0x13 0xaf 0xff 0xef 0x48 0x12 0xa2 0x22 0x00…”;
int key = “mykey”;Method decrypted = D (encrypted, key);return decrypted.invoke( n );}
}