ECIES encryption algorithm parameters
dima91 opened this issue · comments
Luca commented
Hello,
I have to use ECIES encyrption scheme to implement this communications scheme, but for me is hard to understand which parameters I must use in ECIESCtxBuilder
class to create ECIESEncryptionCtx
and ECIESDecryptionCtx
classes.
Can you help me?
Clemens Lang commented
You will have to implement some additional features that we do not provide in this library to implement this scheme:
- We do not currently implement AES-CCM (see https://github.com/bmwcarit/MoCOCrW/blob/openssl1.1/src/mococrw/symmetric_crypto.h#L34-L39)
- You need to implement the
mococrw::KeyDerivationFunction
(see src/mococrw/kdf.h) interface forSHA256(S || counter)
- You need to implement
SymmetricCipherI
(see https://github.com/bmwcarit/MoCOCrW/blob/openssl1.1/src/mococrw/symmetric_crypto.h#L96) forE(m, k) = m ⊕ k
.
Once you have those, you should be able to implement this algorithm using our abstraction by using
ECIESCtxBuilder()
.setKDF(your_sha256_kdf)
.setSymmetricCipherFactoryFunction([](const std::vector<uint8_t> &key) -> std::unique_ptr<XORCipher> {
return XORCipherBuilder().setKey(key).buildEncryptor(); // or buildDecryptor(), but that'll be the same for XOR anyway
})