Presentation is loading. Please wait.

Presentation is loading. Please wait.

Running An Encrypted Java Program

Similar presentations


Presentation on theme: "Running An Encrypted Java Program"— Presentation transcript:

1 Running An Encrypted Java Program

2 Contents Problem Description Solution

3 I. Problem Description Develop a program that uses the Caesar cipher to encrypt .class file. After that, develop another program that can execute the encrypted Java program if it is provided the correct key. The Caesar cipher has a key between 1 and 255. To encrypt, simply add that key to every byte and reduce modulo 256. To decrypt, simply subtract the key from every byte.

4 To write a class loader Extend the ClassLoader class and override the method findClass(String className) The loadClass method of the ClassLoader superclass takes care of the delegation to the parent and calls findClass only if the class hasn't already been loaded and if the parent class loader was unable to load the class.

5 The implementation of this method must do the following:
1. Load the bytecodes for the class from the local file system or from some other source. 2. Call the defineClass method of the ClassLoader superclass to present the bytecodes to the virtual machine.

6 II. Solution Developing a Caesar Cipher Program
Developing a Program that Executes an Encrypted Java Program

7 1. Developing a Caesar Cipher Program

8 2. Developing a Program that Executes an Encrypted Java Program
2.1 Developing the Model 2.2 Developing the View 2.3 Adding a Listener to Execute Button

9 2.1 Developing the Model

10

11

12 2.2 Developing the View

13 2.3 Adding a Listener to Execute Button


Download ppt "Running An Encrypted Java Program"

Similar presentations


Ads by Google