add salt to hash

fdroid
Kherel 2 years ago
parent 695c91cba7
commit 536ef4b717
  1. 4
      lib/logic/models/user.dart
  2. 1
      lib/ui/pages/server_details/chart.dart
  3. 10
      lib/utils/crypto.dart
  4. 7
      pubspec.lock
  5. 1
      pubspec.yaml

@ -1,9 +1,9 @@
import 'dart:ui';
import 'package:crypt/crypt.dart';
import 'package:equatable/equatable.dart';
import 'package:selfprivacy/utils/color_utils.dart';
import 'package:hive/hive.dart';
import 'package:selfprivacy/utils/crypto.dart';
part 'user.g.dart';
@ -25,7 +25,7 @@ class User extends Equatable {
Color get color => stringToColor(login);
String get hashPassword => convertToSha512Hash(password);
String get hashPassword => Crypt.sha512(password).toString();
String toString() {
return login;

@ -5,6 +5,7 @@ class _Chart extends StatelessWidget {
@override
Widget build(BuildContext context) {
var cubit = context.watch<HetznerMetricsCubit>();
var period = cubit.state.period;
var state = cubit.state;

@ -1,10 +0,0 @@
import 'dart:convert';
import 'package:crypto/crypto.dart';
String convertToSha512Hash(String text) {
var bytes = utf8.encode(text);
var hash = sha512.convert(bytes);
return hash.toString();
}

@ -176,6 +176,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
crypt:
dependency: "direct main"
description:
name: crypt
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.1"
crypto:
dependency: "direct main"
description:

@ -10,6 +10,7 @@ environment:
dependencies:
flutter:
sdk: flutter
crypt: ^4.0.1
crypto: ^3.0.0
cubit_form: ^1.0.0-nullsafety.0
cupertino_icons: ^1.0.2

Loading…
Cancel
Save