7
$\begingroup$

Is a secret key generated with its own public and private keys any less secure than a "normal" secret key generated using DH key exchange?

Example:

KeyPair keyPair = kpg.genKeyPair();
publicKey = (DHPublicKey) keyPair.getPublic();
privateKey = (DHPrivateKey) keyPair.getPrivate();

KeyAgreement keyAgreement = KeyAgreement.getInstance("DH");
keyAgreement.init(privateKey);
keyAgreement.doPhase(
    KeyFactory.getInstance("DH")
        .generatePublic(
            new DHPublicKeySpec(publicKey.getY(), P, G)
        ),
    true);

secretKey = keyAgreement.generateSecret();
$\endgroup$
6
$\begingroup$

In traditional DH Key exchange, users A and B derive a common secret $g^{ab}$ from their respective key pairs $(pk_A=g^a, sk_A=a)$ and $(pk_B=g^b, sk_B=b)$. Aside from active attacks, the security of the scheme depends on the Computational Diffie-Hellman (CDH) assumption, since it is difficult to compute $g^{ab}$ from public keys $g^{a}$ and $g^{b}$.

If you perform the key agreement with yourself, you end up obtaining the secret $g^{a^2}$. The question now is if computing $g^{a^2}$ from your public key $g^a$ is difficult. The Square Computational Diffie-Hellman (SCDH) assumption says that, indeed, it is difficult. It can be proved that SCDH and CDH are equivalent for generic groups.

| improve this answer | |
$\endgroup$
  • $\begingroup$ I'm assuming here that this is a theoretical question. Of course, this provides no additional security than directly deriving a secret from the private key. $\endgroup$ – cygnusv Jun 3 '16 at 10:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.