com.dyuproject.util
Class DiffieHellman
java.lang.Object
com.dyuproject.util.DiffieHellman
public class DiffieHellman
- extends Object
Diffie-Hellman key exchange is a cryptographic protocol that allows two parties
that have no prior knowledge of each other to jointly establish a shared secret
key over an insecure communications channel.
- Author:
- David Yu
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BASE_2
public static final DiffieHellman BASE_2
BASE_5
public static final DiffieHellman BASE_5
generateRandomKeys
public BigInteger[] generateRandomKeys(BigInteger modulus)
- Parameters:
modulus
-
- Returns:
- BigInteger array. Element 0 is privateKey. Element 1 is publicKey.
generatePublicKey
public BigInteger generatePublicKey(BigInteger privateKey,
BigInteger modulus)
getSharedSecretKey
public static BigInteger getSharedSecretKey(BigInteger privateKey,
BigInteger modulus,
BigInteger responseKey)
Copyright © 2013. All Rights Reserved.