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.

C.2 Online Attestation Mechanism<br />

118 ( byte ) 0x00 , ( byte ) 0x00 , ( byte ) 0x00 , ( byte ) 0x00 , ( byte ) 0x00 ,<br />

119 ( byte ) 0x00 , ( byte ) 0x00 , ( byte ) 0x00 , ( byte ) 0x00 , ( byte ) 0x00 ,<br />

120 ( byte ) 0x00 } ;<br />

121 private byte [ ] SignedDataTag = {<br />

122 ( byte ) 0x1F , ( byte ) 0x5F , ( byte ) 0x5D , ( byte ) 0x02 } ;<br />

123 short copyPointer = ( short ) 0 ;<br />

124 f i n a l s t a t i c byte CLA = ( byte ) 0xB0 ;<br />

125 f i n a l s t a t i c byte S t a r t P r o t o c o l = ( byte ) 0x40 ;<br />

126 f i n a l s t a t i c byte s e l f t e s t = ( byte ) 0 x f f ;<br />

127 f i n a l s t a t i c short SW_CLASSNOTSUPPORTED = 0 x6320 ;<br />

128 f i n a l s t a t i c short SW_ERROR_INS = 0 x6300 ;<br />

129 RandomData randomDataGen ;<br />

130 Cipher pkCipher ;<br />

131 byte [ ] r e c e i v i n g B u f f e r = null ;<br />

132 byte [ ] c h a l l e n g e = null ;<br />

133 byte [ ] randomNumber = null ;<br />

134 short b y t e s L e f t = 0 ;<br />

135 short readCount = 0 ;<br />

136 short rCount = 0 ;<br />

137 short s i g n l e n g t h = 0 ;<br />

138 MessageDigest SHA128 ;<br />

139 AESKey cipherKey ;<br />

140 Cipher syCipher ;<br />

141 byte [ ] I n i t i a l i s a t i o n V e c t o r = {<br />

142 ( byte ) 0x6C , ( byte ) 0xDE, ( byte ) 0xBE, ( byte ) 0x7B , ( byte ) 0x89 ,<br />

( byte ) 0x99 ,<br />

143 ( byte ) 0x8C , ( byte ) 0xAF, ( byte ) 0xC5 , ( byte ) 0x7D , ( byte ) 0xB1 , ( byte )<br />

144 0x7C , ( byte ) 0x62 , ( byte ) 0x0A , ( byte ) 0x86 , ( byte ) 0x52 } ;<br />

145 S i g n a t u r e phSign ;<br />

146 PrngSHA256 myPrngHMAC;<br />

147<br />

148 private S e l f t e s t O f f l i n e ( ) {<br />

149 phSign = S i g n a t u r e . g e t I n s t a n c e ( S i g n a t u r e .ALG_RSA_SHA_PKCS1, f a l s e ) ;<br />

150 phSCKeyPair = new KeyPair ( KeyPair .ALG_RSA, KeyBuilder .LENGTH_RSA_512) ;<br />

151 cipherKey = (AESKey) KeyBuilder . buildKey<br />

152 ( KeyBuilder .TYPE_AES_TRANSIENT_DESELECT,<br />

153 KeyBuilder .LENGTH_AES_128, f a l s e ) ;<br />

154 syCipher = Cipher . g e t I n s t a n c e ( Cipher .ALG_AES_BLOCK_128_CBC_NOPAD,<br />

155 f a l s e ) ;<br />

156 myPrngHmac = new PrngSHA256 ( ) ;<br />

157 pkCipher = Cipher . g e t I n s t a n c e ( Cipher .ALG_RSA_NOPAD, f a l s e ) ;<br />

158 phSCKeyPair . genKeyPair ( ) ;<br />

159 SHA128 = MessageDigest . g e t I n s t a n c e ( MessageDigest .ALG_SHA_128,<br />

160 f a l s e ) ;<br />

161 byte [ ] r e s p o n s e B u f f e r = null ;<br />

162 }<br />

163 public s t a t i c void i n s t a l l ( byte bArray [ ] , short bOffset , byte bLength )<br />

164 throws ISOException {<br />

165 new S e l f t e s t O f f l i n e ( ) . r e g i s t e r ( ) ;<br />

166 }<br />

167<br />

270

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

Saved successfully!

Ooh no, something went wrong!