botan
botan copied to clipboard
cli: symmetric encryption provider support
Please add provider support for the "botan encryption" command and implement the needed AES operations with PKCS#11. I could not find any command line tool that I can use for that. OpenSSL's PKCS#11 engine does not support AES either.
This would be nice to have. I don't have a ton of free time right now but would be happy to accept patches for this.
Actually though I think our current PKCS11 wrapper doesn't support symmetric algorithms? @neusdan can you confirm this is the case? If so how hard would it be to add AES etc to the wrapper?
Yes, that's correct. There is no support for symmetric algorithms in the PKCS11 wrapper at the moment.
Haven't used PKCS#11 with symmetric algorithms to date, but i think the addition to the PKCS#11 wrapper itself should be quite easy and straightforward. I think the harder part will be the integration with the existing symmetric algorithm interfaces. For example SymmetricAlgorithm::set_key()
takes a SymmetricKey
which is (at the moment) declared final
.
Hi, may I look into this issue?
@prashanttholia Absolutely. If you have questions or etc feel free to open an issue or leave them here.
Thanks @randombit. I'll surely ask questions when I have any doubts or concerns.
Hi @randombit, I'm extremely apologetic for my disappearance from the thread. I would still like to contribute to the issue. I assure that it will not be a repeat behavior. May I still make a contribution?
@prashanttholia of course
Thanks a lot, @randombit! I'll post an update soon.
@randombit @neusdan, I have a few doubts/queries. I request you to advise me on them -
- How to derive from
SymmetricKey
class for use in PKCS11 wrapper's secret key class? Will wrapping theSymmetricKey
class inside the PKCS11 wrapper be a good solution? - How to provide PKCS11 module path so as to be able to use it through "botan encryption" command?
- I'm using SoftHSM2 as the HSM module. I understand it itself uses botan. I thought it may not be an issue. Please let me know if I should be using some other alternative.
Thanks.
Related: OpenSC's pkcs11-tool has a proposed implementation now: https://github.com/OpenSC/OpenSC/pull/2268
... which just arrived in a release candidate.