Deterministic Key using a seed for ECNamedCurve I am trying to generate deterministic keys using EC curve secp521r1 in java. I went through KDF but, couldn't find any references to use it with EC curves. I would appreciate if someone could point me to KDF or something similar to it for deterministic EC keys. All I need is to generate EC key pair using a passpharse.
Sample code that I am using to generate EC keys in Java:
 ECParameterSpec ecSpec = ECNamedCurveTable.getParameterSpec(&quot;secp521r1&quot;);
        KeyPairGenerator g = KeyPairGenerator.getInstance(&quot;ECDSA&quot;, &quot;BC&quot;);

        g.initialize(ecSpec, new SecureRandom());
        KeyPair pair = g.generateKeyPair();

        KeyFactory fact = KeyFactory.getInstance(&quot;ECDSA&quot;, &quot;BC&quot;);
        PublicKey pub = fact.generatePublic(new X509EncodedKeySpec(pair.getPublic().getEncoded()));
        PrivateKey priv = fact.generatePrivate(new PKCS8EncodedKeySpec(pair.getPrivate().getEncoded()));
The problem is that this requires relatively low level access to the cryptographic algorithms.
In general the private key can simply be set to a set of bits, although it should actually fit in the field. Setting the highest bit to zero is a dirty trick if the runtime(s) do not accept as many random bits as the key size. This will however let you use any kind of KDF to derive the bits.
The public key is nothing more than the private key S multiplied with the generator point. This is where you may get in trouble, as this operation is a low level function that may not be exposed.
In principle you could use ECDH for this using the generator as public point of the &quot;other party&quot;, but the Java API is high enough that it won't directly return the resulting point, making this a useless exercise (other API's may differ though, so I thought I should mention this).
So in general you'll need a low level API to perform functions like that.

In your case the best way forward is to use the Bouncy Castle libraries, where such low level functionality is supplied by the lightweight cryptography API. Bouncy Castle also has a nice set of KDF's that you can use. I know 'cause I did the initial implementation.