26
02/20/11 Software Watermarking James Hamilton, PhD Student 0 1 0 0 0 0 1 1 0 1 1 0 0 0 1 0 0 1 1 0 1 0 1 0 0 1 0 1 0 1 0 1 1 0 0 1 0 0 0 1 1 1 0 1

Static Software Watermarking

Embed Size (px)

DESCRIPTION

Presentation from World Congress on Internet Security 2011, London. Based on the paper "A Survey of Static Software Watermarking" with some thoughts on the usefulness of watermarking for software protection. http://jameshamilton.eu/content/survey-static-software-watermarking

Citation preview

Page 1: Static Software Watermarking

02/20/11Software WatermarkingJames Hamilton, PhD Student

0 1 0 0 0 0 1 10 1 1 0 0 0 1 00 1 1 0 1 0 1 00 1 0 1 0 1 0 11 0 0 10 0 0 1 1 1 0 1

Page 2: Static Software Watermarking

2

Software Watermarking - Motivation

software company

software 'thief'

00010101010101011011110101001011010101101010101001010101010101010110100100000001010101011010010101011111111010

00010101010101011011110101001011010101101010101001010101010101010110100100000001010101011010010101011111111010copy

Page 3: Static Software Watermarking

3

Software Watermarking – what is it?

software company

software 'thief'

0001010101010101101111010100MICROSOFT11010101001010101010101010110100100000001010101011010010101011111111010 copy

0001010101010101101111010100MICROSOFT11010101001010101010101010110100100000001010101011010010101011111111010

Allows the software author

to prove ownership.

Page 4: Static Software Watermarking

4

Software Fingerprinting – what is it?

software company

00010101010101011011110101001234567890101010101001010101010101010110100100000001010101011010010101011111111010 copy

Allows the software author

to prove the source of the

copied software.

00010101010101011011110101001234567890101010101001010101010101010110100100000001010101011010010101011111111010

software 'thief'

Page 5: Static Software Watermarking

5

Software Watermarking – what is it not?

• It does not prevent copying software.• It does not prevent decompilation or program understanding.• But it could be used in-conjunction with obfuscation (need to be

careful the obfuscation doesn't remove the watermark).

Obfuscate

Decompile

public class HelloWorld { public String wm = “Microsoft”; public static void main(String[] args) { System.out.println(“Hello World”); }}

Page 6: Static Software Watermarking

6

Static Software Watermarking

Page 7: Static Software Watermarking

7

Dynamic Software Watermarking

• Embeds code to generate a watermark at run-time.• Recogniser uses a debugger to extract watermark.• Should be resilient to semantics-preserving transformations.

.

Page 8: Static Software Watermarking

8

Code Replacement & Addition

• Very basic, early algorithms simply replaced sections of code, or data, with watermark code.

• Susceptible to collusive attacks if the watermarks are placed in the same location in every copy of a program.

• Monden et al. [1] encode the watermark as a sequence of bytecode sequences which replace instructions in a dummy method.

– difficult to generate code which is similar to the original program– easily remove by semantics-preserving transformations

[1] A. Monden, H. Iida, K.-ichi Matsumoto, K. Inoue, and K. Torii, “A practical method for watermarking java programs,” Computer Software and Applications Conference, 2000. COMPSAC 2000. The 24th Annual International, Washington, DC, USA: IEEE, 2002, p. 191–197.

Page 9: Static Software Watermarking

9

Code Re-Ordering

• The watermark is encoded as the nth permutation of some set

• Davidson and Myhrvold [1] encode the watermark as the nth permutation of the set of basic blocks in a method.

– higly unstealthy due to a greater ratio of goto instructions [2]

• Another option, in Java, is to re-order the constant pool (Gong et al.)

• Requires the original program from comparison

[1] R.I. Davidson and N. Myhrvold, “Method and system for generating and auditing a signature for a computer program,” US Patent 5,559,884, Sep. 1996.[2] Myles, G. et al., 2005. The evaluation of two software watermarking algorithms. Softw. Pract. Exper., 35(10), 923–938.[3] D. Gong, F. Liu, B. Lu, and P. Wang, “Hiding Informationin in Java Class File,” International Symposium on Computer Science and Computational Technology, 2008. ISCSCT ’08., IEEE Computer Society, 2008, pp. 160-164.

Page 10: Static Software Watermarking

10

Register Allocation

• the watermark is encoded in the interference graph, which is used to model the relationship between variables.

• each vertex represents a variable and an edge between the two variables indicates that their live ranges overlap.

• we colour the graph in order to minimise the number of registers and ensure that two live variables do no share a register.

• QP algorithm [1] adds edges to the graph

• QP is flawed; QPS, QPI, CC and CP followed with a similar idea.

[1] G. Qu and K. Potkonjak, “Analysis of watermarking techniques for graph coloring problem,” Computer-Aided Design, 1998. ICCAD 98. Digest of Technical Papers. 1998 IEEE/ACM International Conference on, San Jose, California, United States: IEEE, 2005, p. 190–193.

Page 11: Static Software Watermarking

11

Graph Watermarking

• Venkatesan et al. [1] encode the watermark in a CFG and 'connect' it to the original program.

[1] R. Venkatesan, V. Vazirani, and S. Sinha, “A graph theoretic approach to software watermarking,” Information Hiding, Springer, 2001, p. 157–168.

Page 12: Static Software Watermarking

12

Example of a bad watermarking algorithmpush 4push 52push 34push 12poppoppoppoppush 1push 23push 1push 4poppoppoppop

Optimiser

Page 13: Static Software Watermarking

13

Problems with static watermarks in general

• can be unstealthy, if the watermark code is compared with 'normal' code

• highly susceptible to semantics-preserving transformations– static watermarks rely on syntactic properties

• without perfect tamper-proofing techniques an attacker can apply any semantics-preserving transformation to a program

– tamper-proofing is hard & unstealthy• especially in Java

• Static watermarks are not good for software protection

Conclusion

Page 14: Static Software Watermarking

14

What about dynamic watermarks?

• in theory, should not be susceptible to semantics-preserving transformations (but some current ones are).

• but, they can only protect a complete program rather than single modules, classes, methods etc.

• can be susceptible to additive attacks

• Better than static watermarks, but still not great.

Conclusion

Page 15: Static Software Watermarking

15

Watermark Stealthiness

• Some watermarking algorithms are unstealthy– easy to find– 'strange looking' code– doesn't act like the rest of the program

• statistical analysis of instructions (e.g. ratio of goto instructions)• program slicing metrics

Page 16: Static Software Watermarking

16

Program slicing

public void w() { int a = 1; b = a + 1; String wm = “mywatermark”; return b;}

slicing criteria

[1] Weiser, M., 1981. Program slicing. In ICSE '81: Proceedings of the 5th international conference on Software engineering. Piscataway, NJ, USA: IEEE Press, p. 439―449.

Program Slice [1]: An independent program guaranteed to faithfully represent the original program within the domain of the specified subset of behaviour

Page 17: Static Software Watermarking

17

Program slicing

public void w() { int a = 1; b = a + 1; String wm = “mywatermark”; return b;}

slicing criteria

program slice shown in red

Page 18: Static Software Watermarking

18

Program slicing

public void w() { int a = 1; b = a + 1; String wm = “mywatermark”; return b;}

slicing criteria

Page 19: Static Software Watermarking

19

Opaque predicates

• A predicate that's outcome is known a-priori• Can be used to protect watermarks from slicing attacks

• Introduces false dependencies to stop slicing

public void w() { int a = 1; b = a + 1; String wm = “mywatermark”; if(PF) { b = wm.length(); } return b;}

Page 20: Static Software Watermarking

20

Problems with watermarks in general

software company

software 'thief'

judge

Prove that the software is yours

here's my watermark

Page 21: Static Software Watermarking

21

Problems with watermarks in general

software company

software 'thief'

judge

and here's my watermark

who can I believe?

Page 22: Static Software Watermarking

22

Problems with watermarks in general

software company

software 'thief'

judge

independent software expert

I've examined the watermark recogniser carefully, and believe I that

only one recogniser is genuine

Page 23: Static Software Watermarking

23

Problems with watermarks in general

software company

software 'thief'

judge

independent software expert

show me your source-code.

the real author could demonstrate ownership by showing the source-code of their software (without the need for software watermarks)

Page 24: Static Software Watermarking

24

Decompilation

• The attacker could decompile the the program to get their own source-code to demonstrate they own the code

• But it will 'look' decompiled– incoherent variable names– no comments– verbose code– extraneous instructions

• The attacker will probably have little understanding of the code and will have trouble answering trivial questions about it

Page 25: Static Software Watermarking

25

Conclusion

• There are many static watermarking algorithms but they are all susceptible to trivial semantics-preserving transformation attacks.

• Dynamic watermarks are better but can also be susceptible to attacks.

• Unstealthy watermarks give an attacker clues and allow them to remove a watermark easier.

• Program slicing may be able to give clues about watermarks, and/or help remove them.

• Maybe watermark is not actually needed or useful.

Page 26: Static Software Watermarking

26

Any comments or questions?

Thanks

http://jameshamilton.eu/http://www.gold.ac.uk/computing