/* All work, ineffciencies, and bugs Copyright 2001 Kevin Fu May be freely reproduced for educational or personal use November 13, 2001 6.857 Network and Computer Security http://web.mit.edu/6.857/www/ */ import java.io.*; import java.util.*; public class eggTimer { public static void main(String args[]) throws Exception { // might be useful... Random rnd = new Random(); // sample of how to call smartcard... eggSmartCard e = new eggSmartCard(); short p[] = {0x03, 0x04, 0x45, 0x44, 0xF1, 0x6A, 0xCA, 0xFE}; short c[] = new short[8]; short p2[] = new short[8]; try { pp("Msg in: ", p); e.timeScramble(p,c); e.timeUnscramble(p2,c); pp( " encrypts to ", c); System.out.println(); pp("which decrypts to ", p2); } catch (Exception e){ e.printStackTrace(); } } public static void pp(String s, short a[]) { System.out.print(s); for (int i=0; i