Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace gcrypyt, libsodium, libargon2 with Botan #3200

Closed
droidmonkey opened this issue May 31, 2019 · 9 comments
Closed

Replace gcrypyt, libsodium, libargon2 with Botan #3200

droidmonkey opened this issue May 31, 2019 · 9 comments
Assignees
Labels
pr: refactoring Pull request that refactors code
Milestone

Comments

@droidmonkey
Copy link
Member

droidmonkey commented May 31, 2019

Summary

Botan has full 2d/2i/2id support. We also support AES, ChaCha and Twofish (among others) with all common modes (CBC, CTR, GCM, XTS, etc). PKCS #11 Support

POC version for NeoPG with botan and PKCS#11 and you can play around with that to get some idea how this works. I currently plan to implement this in NeoPG. (See #255 for PKCS#11 support)

Botan on GitHub: https://github.com/randombit/botan/

Context

Botan was audited by a team in 2015 who found some issues (which were all resolved) https://botan.randombit.net/releases/audit_1.11.18.pdf

Various bug reports have also been provided by different researchers and crypto engineers. I cannot know how carefully any one of them checked the whole library though. You can see all reported security issues botan.randombit.net/security.html

In 2017 it was reviewed and approved by the German BSI (Federal Office for Information Security) for government use https://bsi.bund.de/SharedDocs/Downloads/DE/BSI/Krypto/Projektzusammenfassung_Botan.html and is used by open source projects such as strongSwan, ISC KEA, and Shadowsocks-qt5, and companies including Rockwell Automation, Panasonic, Mazda, IBM, Bosch, PSPDFKit, and Rohde & Schwarz among others randombit/botan/wiki/Users

Also FWIW I build and review cryptographic systems for a living. I have contributed changes to other libs including OpenSSL and mbedtls, and currently maintain the crypto code used in a FIPS validated HSM.

Maintainer is @randombit

@droidmonkey droidmonkey added new feature pr: refactoring Pull request that refactors code labels May 31, 2019
@phoerious
Copy link
Member

Lowest Ubuntu version to have Botan is Bionic.

@randombit
Copy link

I checked out latest master to see if there is anything else that would be missing.

I noticed you are using Bcrypt-PBKDF for the SSH key support, which motivated me to finish adding support for that, I had written most of it last year but never got around to completing it randombit/botan#1990 Obviously you can't use that unless you're willing to require the latest (or for now, unreleased) version, but it'll be there later if you want it.

Other things I noticed, all already directly supported or easily implemented using any version in 2.x release series:

RSA
secure malloc (secure_vector, or Botan::allocate_memory for malloc-style interface)
RNG (https://botan.randombit.net/manual/rng.html)
Salsa20
SHA-1/SHA-256/SHA-512
TOTP calculator (https://botan.randombit.net/manual/otp.html)
AesKdf - not built in, but doable with a few lines w/ BlockCipher interface

@droidmonkey
Copy link
Member Author

droidmonkey commented Jan 27, 2021

This has been completed after much effort by myself. Ready for PR this weekend and deployment with 2.7.0. I want to thank @randombit for such amazing software that is incredibly well documented and the code is very readable.

@droidmonkey droidmonkey added this to the v2.7.0 milestone Jan 27, 2021
@droidmonkey droidmonkey self-assigned this Jan 27, 2021
@droidmonkey droidmonkey changed the title Replace libsodium and libargon2 with Botan Replace gcrypyt, libsodium, libargon2 with Botan Jan 27, 2021
@droidmonkey
Copy link
Member Author

droidmonkey commented Jan 27, 2021

@randombit, any chance you can get version 2.11 or better deployed to Bionic (currently stuck at 2.4)? Less concerned about Xenial but Bionic is going to be around for a while.

@randombit
Copy link

@droidmonkey Sorry missed this earlier. Do you mean a backport? TBH I think such a request would have more weight coming from the KeepassXC team.

Another alternative would be to bundle an amalgamation build which is used whenever the underlying distro version is too old. Not ideal I admit.

@droidmonkey
Copy link
Member Author

We are going to include in our ppa for xenial builders. I am not sure how to release a new version into an LTS distro, we have failed at getting our own software to be updated and it's not even a library...

@droidmonkey
Copy link
Member Author

This was completed in #6209

@jirutka
Copy link

jirutka commented Oct 3, 2021

When can we expect the first release with the Botan support?

@droidmonkey
Copy link
Member Author

2.7.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: refactoring Pull request that refactors code
Projects
None yet
Development

No branches or pull requests

4 participants