All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object
|
+----is.hi.logir.cryptonite.Cryptonite
|
+----is.hi.logir.cryptonite.K
|
+----is.hi.logir.cryptonite.DHKey
CDS for a Diffie-Hellman key is DHKey(a,g,m,pub)
for a public key or DHKey(a,g,m,pri) for a private
key. In both cases a,g and m are
hexadecimal numbers.
a in the group
modulo m with generator g.
n
n bit modulo.
g > 1 with
gcd(g,m)=1.
p < 2^n
such that (p-1)/2 is prime.
public DHKey(BigInteger a,
BigInteger g,
BigInteger m,
boolean pri)
a in the group
modulo m with generator g. It is a
private key iff pri is true.
public DHKey(int n)
n
Pe-calcualted modula exist for bit lengths 256, 512 and 1024. (The 2048 bit
modulus is still being calculated. Using these values saves a
lot of time and does not weaken the keys.
public static BigInteger getModulus(int n)
p < 2^n
such that (p-1)/2 is prime.
public static BigInteger getGenerator(BigInteger m)
g > 1 with
gcd(g,m)=1.
public static KeyPair createKeys(int n)
n bit modulo.
Pe-calcualted modula exist for bit lengths 256, 512, 1024 and 2048. Using these values saves a lot of time and does not weaken the keys.
public int getSize()
public String getAlgorithm()
public boolean isPrivate()
public DHKey getPublic()
public BigInteger getKey()
public BigInteger getM()
public BigInteger getG()
public final boolean equals(Object o)
public boolean matches(Key key)
public String toString()
All Packages Class Hierarchy This Package Previous Next Index