563.11.1 Java Card Programming: Overview Presented by: Raman Sharykin PISCES Group: Soumyadeb Mitra, Sruthi Bandhakavi, Ragib Hasan, Raman Sharikyn University.

Slides:



Advertisements
Similar presentations
wwwcsif.cs.ucdavis.edu/~jacksoni
Advertisements

1 Classes and Objects in Java Basics of Classes in Java.
1 Multithreaded Programming in Java. 2 Agenda Introduction Thread Applications Defining Threads Java Threads and States Examples.
1 Packages: Putting Classes Together. 2 Introduction The main feature of OOP is its ability to support the reuse of code: Extending the classes (via inheritance)
1 Exceptions: An OO Way for Handling Errors Rajkumar Buyya Grid Computing and Distributed Systems (GRIDS) Laboratory Dept. of Computer Science and Software.
1 Streams and Input/Output Files Part I. 2 Introduction So far we have used variables and arrays for storing data inside the programs. This approach poses.
Chapter 7 Constructors and Other Tools. Copyright © 2006 Pearson Addison-Wesley. All rights reserved. 7-2 Learning Objectives Constructors Definitions.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 12 Introduction to ASP.NET.
Copyright © 2003 Pearson Education, Inc. Slide 1.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Copyright © 2006 by The McGraw-Hill Companies,
Program Verification Using the Spec# Programming System ETAPS Tutorial K. Rustan M. Leino, Microsoft Research, Redmond Rosemary Monahan, NUIM Maynooth.
4 Copyright © 2005, Oracle. All rights reserved. Creating the Web Tier: Servlets.
8 Copyright © 2005, Oracle. All rights reserved. Object Life Cycle and Inner Classes.
1 Copyright © 2005, Oracle. All rights reserved. Introducing the Java and Oracle Platforms.
0 - 0.
SUBTRACTING INTEGERS 1. CHANGE THE SUBTRACTION SIGN TO ADDITION
MULT. INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
Addition Facts
Using Java without BlueJ BlueJ projects A BlueJ project is stored in a directory on disk. A BlueJ package is stored in several different files.
1 Java Card Technology Prepared by:Ali Toyserkani Adopted from: Introduction to Java Card Technology C. Enrique Ortiz.
Java Card Technology Ch04: Java Card Object
Security of JavaCard smart card applets Erik Poll University of Nijmegen
Automata-Based Programming Technology Extension for Generation of JML Annotated Java Card Code Andrey Klebanov, CTD, SPb SU ITMO supervised by Anatoly.
ITEC200 Week04 Lists and the Collection Interface.
1 Symbol Tables. 2 Contents Introduction Introduction A Simple Compiler A Simple Compiler Scanning – Theory and Practice Scanning – Theory and Practice.
© Glenn Rowe AC Lab 2 A simple card game (twenty- one)
Object Oriented Programming with Java
1.A computer game is an example of A.system software; B.a compiler; C.application software; D.hardware; E.none of the above. 2.JVM stands for: A.Java Virtual.
CS12230 Introduction to Programming Lecture 4-x – Consolidation 1.
Addition 1’s to 20.
25 seconds left…...
Test B, 100 Subtraction Facts
Week 1.
CS 1 Introduction CS 1 Part 11. Hardware 1.Central Processing Unit (CPU) 2.Main Memory 3.Secondary Memory / Storage 4.Input Devices 5.Output Devices CS.
Introduction to Programming G51PRG University of Nottingham Revision 1
Java Card Technology Ch07: Applet Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Computer Science & Engineering.
Written by: Dr. JJ Shepherd
Lab Information Security Using Java (Review) Lab#0 Omaima Al-Matrafi.
Lab#1 (14/3/1431h) Introduction To java programming cs425
Client Side Programming Using Java Applet Outcomes: You will be expected to know: – Java Applets and HTML file; –bytecode and platform independent programs;
George Blank University Lecturer. CS 602 Java and the Web Object Oriented Software Development Using Java Chapter 4.
March 2005Java Programming1. March 2005Java Programming2 Why Java? Platform independence Object Oriented design Run-time checks (fewer bugs) Exception.
Chapter 6 Memory and Programmable Logic Devices
Lecture 1: Overview of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++ Designed.
Intro to Java The Java Virtual Machine. What is the JVM  a software emulation of a hypothetical computing machine that runs Java bytecodes (Java compiler.
OOP Languages: Java vs C++
Java Card Open Platform Combines tomorrow's technology and platforms C:\Presentations - JavaCard_OpenPlatform.ppt - bsc page 1 Programming.
Java Security. Topics Intro to the Java Sandbox Language Level Security Run Time Security Evolution of Security Sandbox Models The Security Manager.
CSM-Java Programming-I Spring,2005 Introduction to Objects and Classes Lesson - 1.
1 The Java Virtual Machine Yearly Programming Project.
Introduction to Object Oriented Programming. Object Oriented Programming Technique used to develop programs revolving around the real world entities In.
Java: Chapter 1 Computer Systems Computer Programming II.
By Nicholas Policelli An Introduction to Java. Basic Program Structure public class ClassName { public static void main(String[] args) { program statements.
Java Card Technology Ch09: Applet Firewall and Object Sharing Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Computer.
Netprog: Java Intro1 Crash Course in Java. Netprog: Java Intro2 Why Java? Network Programming in Java is very different than in C/C++ –much more language.
1 © 2002, Cisco Systems, Inc. All rights reserved. Arrays Chapter 7.
Chapter 6 Introduction to Defining Classes. Objectives: Design and implement a simple class from user requirements. Organize a program in terms of a view.
1. An Introduction A Programming Language A Technology Java Development Kit Java API One Language: Three Editions Standard Edition Enterprise Edition.
Java Card Technology Ch08: Working with APDUs
How to execute Program structure Variables name, keywords, binding, scope, lifetime Data types – type system – primitives, strings, arrays, hashes – pointers/references.
TPR 3211 Project 1 Project Title: AES in Javacard Project ID: 221 Supervisor: Mr. Safi Uddin Moderator: Mr. Murugadoss.
Introduction Architecture Hardware Software Application Security Logical Attack Physical Attack Side channel Attack.
Quick Review of OOP Constructs Classes:  Data types for structured data and behavior  fields and methods Objects:  Variables whose data type is a class.
Written by: Dr. JJ Shepherd
6.2 Classes “ A class is basically a structure with member functions as well as member data. Classes are central to the programming methodology known as.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
1. Presentation Agenda  Identify Java Card Technology  Identify Elements of Java Card applications  Communicating with a Java Card Applet  Java Card.
JAVA MULTIPLE CHOICE QUESTION.
(Computer fundamental Lab)
Object Oriented Programming in java
Presentation transcript:

Java Card Programming: Overview Presented by: Raman Sharykin PISCES Group: Soumyadeb Mitra, Sruthi Bandhakavi, Ragib Hasan, Raman Sharikyn University of Illinois Spring 2006

2 Overview Java Cards Java Card/Terminal System Features of Java for Java Cards compared to Java Java Card Applets: Developing Cycle Structure of Applets and Messages On approach to overcome the issue of restricted resources on card Game of Battleship: Using terminals memory

3 Java Card Features Receives clock and power from terminal Three types of memory: –Random Access Memory (RAM) –Read-Only Memory (ROM) –Erasable Read-Only Memory (EEPROM) Restricted Resources –Slow and simple microprocessor (8-bit) –RAM ~1Kb –ROM ~64Kb –EEPROM ~16-64Kb Restricted Version of Java

4 The use of Java Cards SIM cards in cell phones Identity cards (government, health-care) Financial cards supporting online and offline transactions Smart tickets for mass transit

5 Java Card/Terminal System APDU = Application Protocol Data Unit An introduction to Java Card Technology

6 Java for Java Cards Features Small primitive data types: boolean, byte, short. One dimensional arrays. Object oriented features: inheritance, virtual methods, dynamic object creation, overloading, scope. Large primitive data types: long, double, float. Characters, strings. Multidimensional arrays. Dynamic class loading. Garbage collection. Threads. Object Cloning. SupportedNot Supported

7 Developing a Java Card Applet 1.Write the Java source 2.Compile your source 3.Convert the class files into a Converted Applet (CAP) file (binary representation of classes and interfaces) 4.Verify that the CAP is valid (structure, valid bytecode subset, inter-package dependencies) 5.Install the CAP file

8 Message-Passing Model An introduction to Java Card Technology

9 APDU Structure CLA, INS define the command P1, P2 – parameters Lc – data field lentgh Le – maximum response length SW1, SW2 – response status An introduction to Java Card Technology

10 Applet Structure import javacard.framework.*... public class MyApplet extends Applet { // Definitions of APDU-related instruction codes... MyApplet() {...} // Constructor // Life-cycle methods install() {...} select() {...} deselect() {...} process() {...} // Private methods... }

11 Important Methods: Install install() called when a new applet is being installed public static void install ( byte[] bArray, short bOffset, byte bLength) { new myApplet(null); } –Must call register() to let JCRE know that a new applet has been installed.

12 Important Methods: Select/Deselect select() –when we want to use an applet –is called when SELECT APDU is received deselect() –is called when another SELECT APDU is received

13 Important Methods: Use process() –when an APDU is received and applet is selected its method process is called to process the APDU –the selected applet parses the APDU and perform whatever it needs to perform –normally the body of process() method is a big switch with code for each INS value defined

14 A Challenge in Java Card Programming Java Cards have very restricted resources –Limited Memory –Limited Computing Power Can we use terminals resources to overcome the restriction provided that the terminal is potentially untrusted? At Penn we used terminals memory to overcome the first restriction

15 Game of Battleship Playing Field is n by n Ships are vertical or horizontal and of a fixed length Players shoot in turns The winner is the player who has eliminated the ships of the opponent first

16 How to Prevent Cheating? Before starting the game players assign random numbers to each cell, compute the hash of the resulting pair and exchange the tables of hashes When a player shoots, the opponent provides not only the contain of the requested cell, but also the random number assigned to it and the hash This way the other player can compute the hash of the delivered data and check if it coincides with the value stored in the beginning.

17 Terminal Services Card If we want to play the game on 10 by 10 field we need 10*10*16*2 = 3200 bytes when only ~600 is available We used terminals memory to store the tables of random numbers and hashes To request a services from the terminal we have two types of respond APDUs –The result –A request from the card to perform an operation (store or retrieve data)

18 Terminals Structure Java Card Service Layer Application Terminal request service request1 service repond1 service request2 service repond2 respond

19 Data Flow and the Structure of an Applet TerminalJava Card Request Service Request 1 Respond process(apdu) {..... switch (message){.... case Request:..... send ServiceRequest1; break;..... case ServiceResponde1:..... send ServiceRequest2; break;..... case ServiceResponde2:..... send Respond; } Service Respond 1 Service Request 2 Service Respond 2

20 Future Work The implementation stores its data on terminal without making sure that the server does not alternate the stored data (also it can just look at it!) The structure of the code on card is complicated when we need Service Requests –inside a function call –inside a loop It would be interesting to know if we can use the computational power of the terminal as well