180 likes | 191 Views
This project focuses on using obfuscation to transform code for enhanced security. Learn about identifier renaming and external entity handling. Explore mandatory and optional requirements for the transformation process.
E N D
The Project of this year Mariano Ceccato FBK - Fondazione Bruno Kessler ceccato@fbk.eu The Project of this year
Obfuscation • Obfuscation transforms a program into a new program which: • Has the same semantics • Is harder to reverse engineer The Project of this year
1 Student x1 = new Student(); 2 String x2 = “Mathematics”; 3 Course x3 = new Course(x2); 4 x1.apply(x3); 5 x3.run(); 6 x2.match(“Alice”); Example: Identifier Renaming 1 Student guy = new Student(); 2 String name = “Mathematics”; 3 Course course = new Course(name); 4 guy.apply(course); 5 course.run(); 6 name.match(“Alice”); The Project of this year
Example: Identifier Renaming 1 Student guy = new Student(); 2 String name = “Mathematics”; 3 Course course = new Course(name); 4 guy.apply(course); 5 course.run(); 6 name.match(“Alice”); 1 y1 x1 = new y1(); 2 String x2 = “Mathematics”; 3 y2 x3 = new y2(x2); 4 x1.z1(x3); 5 x3.run(); 6 x2.match(“Alice”); The Project of this year
Example: Identifier Renaming Some identifiers can not be changed: • Library class and method names (GUI, IO, …) • Names inherited from libraries (Thread.run, …) • Native types (int, String, …) • Operators (+, -, …) 1 y1 x1 = new y1(); 2 String x2 = “Mathematics”; 3 y2 x3 = new y2(x2); 4 x1.z1(x3); 5 x3.run(); 6 x2.match(“Alice”); The Project of this year
External entities • Do not change identifiers that refer to external entities (to the library) interface Serializable { publicvoid writeObject(ObjectOutputStream out) ; publicvoid readObject(ObjectInputStream in) ; } class Student implements Serializable { publicvoid writeObject(ObjectOutputStream out) {…} publicvoid readObject(ObjectInputStream in) {…} } The Project of this year
External entities • Do not change identifiers that refer to external entities (to the library) class Person { publicvoid getName( ) { return … } } class Student extends Person { publicvoid getName( ) { return … } } The Project of this year
Internal entities • Change in the same way names that redefines each other The Project of this year
Externally visible entities • Do not change identifiers that have to external visibility (main method) class StudentApplication { public static void main(String[] arg) {…} } The Project of this year
Assignment • Develop a Txl transformation that applies identifier renaming. • Change manes of • Types (classes) • Methods • Fields • Local variables The Project of this year
JSnapScreen 0.1 • http://sourceforge.net/projects/jsnapscreen • Open source java project (2k LoC) • It takes snapshoot of the current screen The Project of this year
Resources • Java grammar for Txl • JSnapScreen code • Separated sources • All the sources in a single file (merged) • JSnapScreen class diagram The Project of this year
Mandatory requirements • Work on the merged file • Change class names • Change method names (excluded main) • Change field names • Change local variable names • Use x1, x2, x3 … as new identifiers • Txl rules must be briefly commented • Deliver a “readme” describing how to run the obfuscator The Project of this year
Optional requirements • Work on separated source files • Avoid changing names of those methods that refer to the library • Use a, b, c … as new identifiers • Reuse identifiers when possible • The changed code compiles • The changed code runs The Project of this year
Delivery • The project must be delivered one week (7 days) before the date of the exam The Project of this year
The rest of the course Txl Obfuscation Web Testing Txl Project Empirical Software Engineering Experiment 1 Experiment 2 The Project of this year
Next classes • No class on April 1st and 4th • Next class on the April 8th The Project of this year