Comments (2)
Sorry, I know this is confusing. The cipher API is kind of weirdly designed. I didn't realize our documentation was that non-specific though, thanks for pointing this out.
You should always call finish
, either when encrypting or decrypting.
In fact you can get away with never calling process
, it exists just for efficiency when dealing with larger messages. It's perfectly fine/correct/easy to just call start
with the nonce then immediately finish
with a buffer containing the entire message.
For your decryption example, things maybe "work" but probably not quite as you're thinking. What's happening is the Poly1305 authentication tag (final 16 bytes) is being decrypted and emitted as if it was part of the message, and so you're both not checking the tag (which allows arbitrary forgeries) but also ending up with 16 bytes of extra junk at the end. Maybe if you're only looking at the first bytes of the plaintext this was not obvious.
from botan.
Thanks for clearing things up !
from botan.
Related Issues (20)
- The dTLS server (1.2) is not handling properly the re-transmissions in case of delay in flight at server side (we see clientKeyExchange before serverKeyExchange and serverHelloDone)
- secp112r2 unsupported since Hasse bound check HOT 1
- Does the string type cause aborted works as intended? HOT 2
- DTLS group handshake messages HOT 6
- Update clang-format rules
- CI needs to test deprecated and experimental builds
- Fuzzers and fuzzer documentation could use some love
- Compile-time output length HOT 3
- Internal: load_be/le should accept a BufferSlicer
- Introduce a notion of budget to X509 path validation
- Add Limbo and BetterTLS to CI HOT 1
- Use a larger sequence number window in DTLS
- Somehow load_{be,le} of integer without offset doesn't work HOT 1
- HSS test failure HOT 1
- ECDSA tests without RFC 6979 quite insufficient
- Follow-up: Introduce reduced KATs and/or ARM32 full run
- FFI: botan_cipher_get_update_granularity() returns 17 HOT 2
- How to implement TLS 1.3 session resumption? HOT 7
- Current master fails to build/link HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from botan.