erly / dbcrypt Goto Github PK
View Code? Open in Web Editor NEWDart port of JBCrypt
License: Other
Dart port of JBCrypt
License: Other
Hi, I'm using this library in a flutter app. It works fine when building an APK. However with recent changes to Android store, a 64bit version is also required. I've started with the conversion to Android Application Bundle (AAB) and ran into an issue where output differs between these versions.
For example:
APK:
DBCrypt result: $2b$06$C6UzMDM.H6dfI/f/IKxGhuVi1DmY0ZHRIOlDzy68M6XV7JwYKuDem
AAB:
DBCrypt result: $2b$06$C6UzMDM.H6dfI/f/IKxGhuct16o.zHWI649k44CjX4q927Dr/1iaS
for this call:
var result = new DBCrypt().hashpw(r'3282aae5-f104-4639-88a3-3af9a1efb069', r'$2b$06$C6UzMDM.H6dfI/f/IKxGhu');
log.fine("DBCrypt result: $result");
I've also tried the unchanged test suite with the dart aot compiler, and get a similar error
dart2aot dbcrypt_test.dart out
00:00 +0: Hash password
00:00 +0 -1: Hash password [E]
Expected: '$2a$06$DCq7YPn5Rq63x1Lad4cll.TV4S6ytwfsfvkgY8jIucDrjc8deX1s.'
Actual: '$2a$06$DCq7YPn5Rq63x1Lad4cll.orYsuQL82N1BwdzuqOJ5NXWjEuHrO.u'
Which: is different.
Expected: ... x1Lad4cll.TV4S6ytwfs ...
Actual: ... x1Lad4cll.orYsuQL82N ...
^
Differ at offset 29
Do you have any clue as to where this difference might come from?
Kind regards,
Jeroen
When try to check password this issue is been throwed
Flutter 0.5.1
new DBCrypt().checkpw('test', '\$2b\$12\$0O5iZrh9JNnOgBP/NprFBe2SS5scgrLsA.Dx6DsmhL3VLQpN/q4Uy')
results in following error
E/flutter (13825): [ERROR:topaz/lib/tonic/logging/dart_error.cc(16)] Unhandled exception:
E/flutter (13825): Invalid salt version
E/flutter (13825): #0 DBCrypt.hashpw (package:dbcrypt/dbcrypt.dart:376:7)
E/flutter (13825): #1 DBCrypt.checkpw (package:dbcrypt/dbcrypt.dart:474:30)
E/flutter (13825): #2 check_secret_key (file:///home/dev/AndroidStudioProjects/secure_pdf_viewer/lib/src/util.dart:20:20)
E/flutter (13825): <asynchronous suspension>
E/flutter (13825): #3 LoginFormState.build.<anonymous closure> (file:///home/dev/AndroidStudioProjects/secure_pdf_viewer/lib/main.dart:60:18)
E/flutter (13825): <asynchronous suspension>
E/flutter (13825): #4 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:494:14)
E/flutter (13825): #5 _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:549:30)
E/flutter (13825): #6 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:102:24)
E/flutter (13825): #7 TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:161:9)
E/flutter (13825): #8 TapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:94:7)
E/flutter (13825): #9 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:315:9)
E/flutter (13825): #10 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:73:12)
E/flutter (13825): #11 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:101:11)
E/flutter (13825): #12 _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:143:19)
E/flutter (13825): #13 _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:121:22)
E/flutter (13825): #14 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:101:7)
E/flutter (13825): #15 _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:64:7)
E/flutter (13825): #16 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:48:7)
E/flutter (13825): #17 _invoke1 (dart:ui/hooks.dart:134:13)
E/flutter (13825): #18 _dispatchPointerDataPacket (dart:ui/hooks.dart:91:5)
Please refer to this gist for code and logs.
Generating salts with the number of rounds less than 4 generating bad number of rounds. Please if possible extend it! for different use cases!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.