[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNU Crypto] Diffie-Hellmann & ElGamal unimplementable?
From: |
David Roth |
Subject: |
[GNU Crypto] Diffie-Hellmann & ElGamal unimplementable? |
Date: |
Sat, 01 Jul 2006 00:22:27 +0200 |
User-agent: |
Thunderbird 1.5.0.4 (Windows/20060516) |
In TestOfDHKeyAgreements.java it says:
private void setUp() {
IKeyPairGenerator kpg =
KeyPairGeneratorFactory.getInstance(Registry.DH_KPG);
kpg.setup(new HashMap()); // use default values
kpA = kpg.generate();
kpB = kpg.generate();
}
With this setting the key agreement works, k1 is equal to k2. So far, no
problem...
But the Test is unrealistic, there are usually two completely
independent classes - Server and
Client - so tried to simulate it with this code:
private void setUp() {
IKeyPairGenerator kpg =
KeyPairGeneratorFactory.getInstance(Registry.DH_KPG);
IKeyPairGenerator kpg2 =
KeyPairGeneratorFactory.getInstance(Registry.DH_KPG);
kpg.setup(new HashMap()); // use default values
kpg2.setup(new HashMap()); // use default values
kpA = kpg.generate();
kpB = kpg2.generate();
}
BUT...
after this, the keys k1 and k2 are NOT equal!
What to do? Did I miss some kind of information?
I've searched everywhere, I've tried everything - for hours and days -
and I never got it to work...
That's why I think it is a bug, it just can't be, that two different
parties can have the same object!?
Just let me know if You have any ideas!
Hopefully, David "Anthales" Roth
PS: Sorry for my English, I'm German ;-)
- [GNU Crypto] Diffie-Hellmann & ElGamal unimplementable?,
David Roth <=