06.11.2014 Views

A User Centric Security Model for Tamper-Resistant Devices

A User Centric Security Model for Tamper-Resistant Devices

A User Centric Security Model for Tamper-Resistant Devices

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

8.2 Smart Card Runtime Environment<br />

Class File<br />

Smart Card<br />

Resource<br />

Java File Compile Packager<br />

File<br />

Installation<br />

Package<br />

Off-Card<br />

Installer<br />

On-Card Bytecode<br />

Verifier<br />

Supporting<br />

Libraries<br />

Installed<br />

Application<br />

Figure 8.1: Java Card application development process<br />

any resource les and supporting libraries into an installation package (e.g. CAP, or JAR<br />

le [16, 28]) that can be downloaded to a Java Card. On the Java Card, the on-card<br />

bytecode verier will analyse the downloaded application and validate that it con<strong>for</strong>ms to<br />

the stated Java language semantics.<br />

The class le contains the bytecode representation of the program code, an example is<br />

illustrated in gure 8.2. The statement if_scmplt 22, at line 08, of bytecode representation<br />

is the opcode <strong>for</strong> if-else statement. The opcode represents that if the statement is<br />

true then proceed with next line otherwise jump to line 22. The JCVM <strong>for</strong> Java Card<br />

3.0.1 has listed approximately 185 opcodes and each opcode (e.g. if_scmplt) has an associated<br />

byte value. For example, opcode if_scmplt is represented as byte values 0x6C<br />

(in hexadecimal <strong>for</strong>mat). The SCRT interprets individual instructions (opcodes) during<br />

the application execution.<br />

00: if (a < b){<br />

01: c = a;<br />

02: }else{<br />

03: c = a;<br />

04: }<br />

Java File<br />

Compile<br />

00: aload_0<br />

01: getfield #14 <br />

04: aload_0<br />

05: getfield #16 <br />

08: if_scmplt 22 (+14)<br />

11: aload_0<br />

12: aload_0<br />

13: getfield #14 <br />

Class File (Bytecode Representation)<br />

16: putfield #23 <br />

19: goto 30 (+11)<br />

22: aload_0<br />

23: aload_0<br />

24: getfield #14 <br />

27: putfield #23 <br />

30: return<br />

Figure 8.2: Java source le to bytecode conversion<br />

Figure 8.3 illustrates the architecture of a typical JCVM except <strong>for</strong> the modules in a dotted<br />

circle (i.e. runtime security manager) which is part of our proposal discussed in section 8.3.<br />

Various components and their functions are described subsequently with emphasis on how<br />

they interact during the execution of an application.<br />

The JCVM mainly deals with an abstract storage unit called word that is the smallest<br />

storage unit that it can process. The actual size of a word is left to the JCVM implementers<br />

and it depends upon the underlying hardware. However, the JCVM specication [16]<br />

states that a word should be large enough to hold a value of byte, short, reference, or<br />

returnAddress.<br />

When an application is initiated, the bytecode representation of an application is loaded<br />

to the JCVM memory by a class loader subsystem. The class loader is responsible <strong>for</strong><br />

190

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!