I am looking for a PKI signature system that I can use on a networking
system I am writing. As such I am looking for a system with the
smallest key-size, key representation, and signature size. From what
I have read Elliptic Curve cryptopgraphy seems to be a very good fit.
There are references on this list and elsewhere to key sizes around
128-150 bits in length.
Based on this I started using crytopp and experimenting with it's EC
systems. The problem is I can't find a way to serialize a key to a
data buffer in a way that it is actually represented as anything close
to 150bits.
Here is some of the code I am currently working with:
-------------------------------------------------
ECIES<EC2N>::PrivateKey priv_key;
ECIES<EC2N>ec_enc_t::PublicKey pub_key;
priv_key.Initialize(randPool, ASN1::sect113r1());
priv_key.MakePublicKey(pub_key);
std::string priv_key_value, priv_key_comp_value,
pub_key_value, pub_key_comp_value;
cryptopp::StringSink priv_key_sink(priv_key_value),
priv_key_comp_sink(priv_key_comp_value),
pub_key_sink(pub_key_value),
pub_key_comp_sink(pub_key_comp_value);
priv_key.Save(priv_key_sink);
pub_key.Save(pub_key_sink);
priv_key.AccessGroupParameters().SetPointCompression(true);
pub_key.AccessGroupParameters().SetPointCompression(true);
priv_key.Save(priv_key_comp_sink);
pub_key.Save(pub_key_comp_sink);
-----------------------------------------------------
>From what I can tell of the code this saves the key out to the strings
using the BER method. Unfortunately this leads to key length of:
166 bytes (1328 bits)
150 bytes (1200 bits)
173 bytes (1384 bits)
142 bytes (1136 bits)
This is much larger then I can use in my application.
What I am looking for is a way to represent the EC keys in the fewest
number of bits possible. My application knows that the bits represent
so there doesn't need to be any extra overhead that identify or
delimit the data.
Can anyone point me to some code that will let me get a compact
representation of ec keys?
Thanks,
Allen