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

47 ( byte ) 0x1F , ( byte ) 0x5F , ( byte ) 0x5E , ( byte ) 0xAF} ;<br />

48 private byte [ ] SCBIdentityTag = {<br />

49 ( byte ) 0x1F , ( byte ) 0x5F , ( byte ) 0x5F , ( byte ) 0x02 , ( byte ) 0x00 , ( byte )<br />

50 0x0C , ( byte ) 0x7A , ( byte ) 0xD5 , ( byte ) 0xB7 , ( byte ) 0xD0 , ( byte ) 0xB6 ,<br />

51 ( byte ) 0xC1 , ( byte ) 0x22 , ( byte ) 0x07 , ( byte ) 0xC9 , ( byte ) 0xF9 ,<br />

52 ( byte ) 0x8D , ( byte ) 0x11 } ;<br />

53 private byte [ ] ExponentTag = {<br />

54 ( byte ) 0x1F , ( byte ) 0x5F , ( byte ) 0xEE , ( byte ) 0x01 } ;<br />

55 private byte [ ] ModulusTag = {<br />

56 ( byte ) 0x1F , ( byte ) 0x5F , ( byte ) 0xEE , ( byte ) 0x02 } ;<br />

57 private byte [ ] SCBDHChalleneTag = {<br />

58 ( byte ) 0x1F , ( byte ) 0x5F , ( byte ) 0x5C , ( byte ) 0x02 } ;<br />

59 private byte [ ] SCBRandomNumberTag = {<br />

60 ( byte ) 0x1F , ( byte ) 0x5F , ( byte ) 0x5A , ( byte ) 0x02 } ;<br />

61 private byte [ ] SCACertificateTag = {<br />

62 ( byte ) 0x1F , ( byte ) 0xC0 , ( byte ) 0xF0 , ( byte ) 0x01 } ;<br />

63 private byte [ ] SCBCertificateTag = {<br />

64 ( byte ) 0x1F , ( byte ) 0xC0 , ( byte ) 0xF0 , ( byte ) 0x02 } ;<br />

65 private byte [ ] SCBProtocolInitiatorTag = {<br />

66 ( byte ) 0x1F , ( byte ) 0x5F , ( byte ) 0xA1 , ( byte ) 0xB2 } ;<br />

67 short PTLVDataOffset = ( short ) 6 ;<br />

68 short CTLVDataOffset = ( short ) 7 ;<br />

69 short TLVLengthOffset = ( short ) 4 ;<br />

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

71 byte [ ] SCBDHData ;<br />

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

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

74 f i n a l s t a t i c byte I n i t i a t i o n P r o t o c o l = ( byte ) 0 x f f ;<br />

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

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

77 RandomData randomDataGen ;<br />

78 Cipher pkCipher ;<br />

79 short messageNumber = 0 ;<br />

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

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

82 short readCount = 0 ;<br />

83 short rCount = 0 ;<br />

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

85 private RSAPublicKey dhKey = ( RSAPublicKey ) KeyBuilder . buildKey<br />

86 ( KeyBuilder .TYPE_RSA_PUBLIC,<br />

87 KeyBuilder .LENGTH_RSA_2048, f a l s e ) ;<br />

88 private byte [ ] randomExponent ;<br />

89 f i n a l s t a t i c byte GEN_KEYCONTRIBUTION = 0x01 ;<br />

90 f i n a l s t a t i c byte GEN_DHKEY = 0x02 ;<br />

91 AESKey phCipherKey ;<br />

92 Cipher syCipher ;<br />

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

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

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

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

97 AESKey phMacGeneratorKey ;<br />

419

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

Saved successfully!

Ooh no, something went wrong!