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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

C.9 Plat<strong>for</strong>m Binding Protocol<br />

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

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

100 KeyPair phSCBKeyPair ;<br />

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

102 RSAPublicKey SCAVerificationKey = null ;<br />

103 private ProtocolHandler ( ) {<br />

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

105 ( KeyBuilder .TYPE_AES_TRANSIENT_DESELECT,<br />

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

107 phMacGenerator = S i g n a t u r e . g e t I n s t a n c e<br />

108 ( S i g n a t u r e .ALG_AES_MAC_128_NOPAD, f a l s e ) ;<br />

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

110 ;<br />

111 phSCBKeyPair = new KeyPair ( KeyPair .ALG_RSA,<br />

112 KeyBuilder .LENGTH_RSA_512) ;<br />

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

114 KeyBuilder .LENGTH_RSA_512) ;<br />

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

116 ( KeyBuilder .TYPE_AES_TRANSIENT_DESELECT,<br />

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

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

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

120 randomDataGen = RandomData . g e t I n s t a n c e<br />

121 (RandomData .ALG_SECURE_RANDOM) ;<br />

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

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

124 phSCBKeyPair . genKeyPair ( ) ;<br />

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

126 }<br />

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

128 bLength ) throws ISOException {<br />

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

130 }<br />

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

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

133 SCBDHData = JCSystem . makeTransientByteArray ( ( short ) ( ( short )<br />

134 this . ClassDH . dhModulus . l e n g t h + PTLVDataOffset ) ,<br />

135 JCSystem .MEMORY_TYPE_TRANSIENT_DESELECT) ;<br />

136 U t i l . arrayCopyNonAtomic ( this . SCBDHChalleneTag , ( short )<br />

137 i n i t i a l P o i n t e r , this . SCBDHData, ( short ) 0 ,<br />

138 ( short ) this . SCBDHChalleneTag . l e n g t h ) ;<br />

139 this . shortToBytes (SCBDHData, ( short ) 4 , ( short ) ( ( short )<br />

140 SCBDHData . l e n g t h − ( short ) PTLVDataOffset ) ) ;<br />

141 this . dhKeyConGen( this . SCBDHData, this . PTLVDataOffset ,<br />

142 ProtocolHandler .GEN_KEYCONTRIBUTION) ;<br />

143 SCADHChanllengerArray = JCSystem . makeTransientByteArray ( ( short ) (<br />

144 ( short ) this . ClassDH . dhModulus . l e n g t h + this . PTLVDataOffset ) ,<br />

145 JCSystem .MEMORY_TYPE_TRANSIENT_DESELECT) ;<br />

146 SCARandomNumberArray = JCSystem . makeTransientByteArray ( ( short ) 22 ,<br />

147 JCSystem .MEMORY_TYPE_TRANSIENT_DESELECT) ;<br />

148 SCACookieArray = JCSystem . makeTransientByteArray ( ( short ) 22 ,<br />

420

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

Saved successfully!

Ooh no, something went wrong!