Comments (6)
By the way - while I found this annoying, the library is otherwise excellent.
from flutter_sodium.
Fair point on documentation and constants for the various keys, this should be added.
The Sodium class contains a 1:1 mapping of Dart to native libsodium functions. My thinking here is that the API should closely match the libsodium signatures using core Dart classes and types. I wanted to leave out any opinionated, custom type from this low-level Sodium API.
To address your concern, a high-level opinionated API has been created, which does contain KeyPair
, SessionKeys
, and other return types for using libsodium in a Dart-friendly manner. See CryptoBox.generateKeyPair
for example, it does return a typed KeyPair
instance.
As far as breaking changes is concerned, this plugin is pre-v1, and I'm still toying with the API. I'm not too concerned about introducing breaking changes.
from flutter_sodium.
Ah, didn't see that, I was just looking at the Sodium class for the most part and made the invalid assumption that the dart API and sodium API would be mostly incompatible (as the libsodium-jni library tends to be - I've used it in the past and have been less than impressed). I'll close this as the wrapper classes seem to resolve any concerns I may have had.
Documentation might be advisable but as an open-source project I 100% understand (I maintain a couple of small libraries myself and realize it's a lot of work - if I get a chance I will try to add a PR). Hopefully this issue will help someone else at least =).
And just out of curiosity have you looked at the LazySodium library as an alternative to libsodium-jni? Their java/android api is a whole lot better than libsodium-jni, although I don't think they compile to quite as many platforms right now and it seems as though you mostly use the native api anyways.
from flutter_sodium.
I did a few tests with LazySodium. I like what they're doing, but I got some incorrect results from various crypto functions. Decided to stick with libsodium_jni for now.
from flutter_sodium.
Hi @kozw,
Maintainer of Lazysodium here. I have fixed a few bugs in the library related to password hashing. Perhaps that solves your incorrect results problem?
Please let me know if it works, you can find my email in my bio. Happy to discuss any problems with lazysodium you're having.
Sorry for resurrecting an old thread :)
from flutter_sodium.
Cool, I'll give it another try. Will keep you in the loop.
from flutter_sodium.
Related Issues (20)
- Invalid plugin specification flutter_sodium. HOT 1
- crypto_secretstream_xchacha20poly1305_pull failed with -1 HOT 1
- Fix .gitignore to exclude source files with local dev info
- Extend library documentation
- Inconsistencies with cryptoPwhashStr across libraries HOT 4
- READ_PHONE_STATE permission implicitly added on android HOT 5
- Plugin with id 'com.android.library' not found. HOT 8
- Migrate to null safety HOT 3
- Cannot use libsodium HOT 7
- Support for Flutter web
- Support for FFI 1.0 HOT 5
- Cover the entire libsodium API HOT 2
- Support for Desktop Platforms (Linux, Windows, macOS) HOT 8
- libsodium.a linker error HOT 4
- Argon2id in sensitive mode gives SodiumException crypto_pwhash failed with -1 HOT 2
- Build issue when using Flutter 2.5.0 HOT 3
- Update pub.dev release HOT 2
- Key derivation using XOR (^) instead of power function HOT 2
- Is this not maintained anymore?
- Upgrade to ffi ^2.0.1
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 flutter_sodium.