A issue about generate a master key

Feb 22, 2012 at 8:47 AM
Edited Feb 22, 2012 at 8:57 AM

Hi all,

 I want to generate a master key using the simulator of version 0.9.5. And I got a error "Invalid data for 3DDecrypt with variant"

 Hereunder is my operations:

 1. Using GC command to generate two components:

 GC

Keylength[1,2,3]:2

KeyType:000

KeyScheme:U

ClearComponent:EC16857CD5FEC81CB920B94CDCDFD091

EncryptedComponent:U18A1EF7C7C2B4294467C7773DAD6C928

Keycheckvalue:849D86

 

GC

Keylength[1,2,3]:2

KeyType:000

KeyScheme:U

ClearComponent:92370BF23DE0529D1FAD207585AD79EA

EncryptedComponent:U184863ECFBC492A9A3CF9070B23DB923

Keycheckvalue:759094

 

2. Using FK command to generate a master key (The encrypted component is necessary):

FK

Key length [1,2,3]: 2

Key Type: 000

Key Scheme: U

Component type [X,H,E,S]: E

Enter number of components (2-9): 2

Enter component #1: U18A1EF7C7C2B4294467C7773DAD6C928

Enter component #2: U184863ECFBC492A9A3CF9070B23DB923

Invalid data for 3DDecrypt with variant

 

I checked the source code. It confused me:

In FromKeyFromComponents_FK.vb 146 line, "components(0).Length <> 33", the components length must be 33.

And here "FromKeyFromComponents_FK.vb 184 line function ProcessMessage" (Utility.DecryptUnderLMK(components(i), ks, LMKKeyPair, var))

-->"Utility.vb 543 line function DecryptUnderLMK"(result = TripleDES.TripleDESDecryptVariant(New HexKey(LMK.LMKStorage.LMKVariant(LMKKeyPair, Convert.ToInt32(variantNumber))), encryptedKey))

-->"TripleDES.vb 127 line function TripleDESDecryptVariant"(data.Length <> 32) the components length must be 32. It's inconsistent. And maybe the error was reported here.

 

Can somebody give me an advise?

Best Regards

Feb 23, 2012 at 5:55 PM

There's a bug in the FK command when encrypted components are used. I posted a fix, you can get the latest changeset or download the latest dev build. Please let me know if this fixes your problem.