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.6 Application Acquisition and Contractual Agreement Protocol<br />

132 private byte [ ] myLongTermMacKey = {<br />

133 ( byte ) 0x74 , ( byte ) 0x86 , ( byte ) 0x6A , ( byte ) 0x08 , ( byte ) 0xCF,<br />

( byte ) 0xE4 ,<br />

134 ( byte ) 0xFF , ( byte ) 0xE3 , ( byte ) 0xA6 , ( byte ) 0x82 , ( byte ) 0x4A , ( byte )<br />

135 0x4E , ( byte ) 0x10 , ( byte ) 0xB9 , ( byte ) 0xA6 , ( byte ) 0xF0 } ;<br />

136 AESKey phCipherKey ;<br />

137 Cipher syCipher ;<br />

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

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

( byte ) 0x99 ,<br />

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

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

142 AESKey phMacGeneratorKey ;<br />

143 S i g n a t u r e phMacGenerator ;<br />

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

145 KeyPair phSCKeyPair ;<br />

146 KeyPair ph<strong>User</strong>KeyPair ;<br />

147 RSAPublicKey SPVerificationKey = null ;<br />

148 RSAPublicKey TSMVerificationKey = null ;<br />

149 private ProtocolHandler ( ) {<br />

150 phMacGeneratorKey = (AESKey) KeyBuilder . buildKey<br />

151 ( KeyBuilder .TYPE_AES_TRANSIENT_DESELECT,<br />

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

153 phMacGenerator =<br />

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_AES_MAC_128_NOPAD,<br />

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

155 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 />

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

157 ph<strong>User</strong>KeyPair = new KeyPair ( KeyPair .ALG_RSA,<br />

KeyBuilder .LENGTH_RSA_512)<br />

158 ;<br />

159 phCipherKey = (AESKey) KeyBuilder . buildKey<br />

160 ( KeyBuilder .TYPE_AES_TRANSIENT_DESELECT,<br />

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

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

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

164 randomDataGen = RandomData . g e t I n s t a n c e (RandomData .ALG_SECURE_RANDOM) ;<br />

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

166 d h I n i t i a l i s a t i o n ( ) ;<br />

167 phSCKeyPair . genKeyPair ( ) ;<br />

168 ph<strong>User</strong>KeyPair . genKeyPair ( ) ;<br />

169 }<br />

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

171 throws ISOException {<br />

172 new ProtocolHandler ( ) . r e g i s t e r ( ) ;<br />

173 }<br />

174 public void i n i t i a l i s e P r o t o c o l ( ) {<br />

175 SID = JCSystem . makeTransientByteArray ( ( short ) 16 ,<br />

176 JCSystem .CLEAR_ON_RESET) ;<br />

177 short i n i t i a l P o i n t e r = 0 ;<br />

178 SCDHData = JCSystem . makeTransientByteArray ( ( short ) ( ( short )<br />

336

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

Saved successfully!

Ooh no, something went wrong!