Skip to content

Instantly share code, notes, and snippets.

@rafaelqueiroz88
Created October 8, 2023 14:21
Show Gist options
  • Save rafaelqueiroz88/c5b6adfdb4bd9b23778bdffc09a4ecfc to your computer and use it in GitHub Desktop.
Save rafaelqueiroz88/c5b6adfdb4bd9b23778bdffc09a4ecfc to your computer and use it in GitHub Desktop.
Encrypting locally password before request
import 'dart:convert';
// package needed: https://pub.dev/packages/crypto
import 'package:crypto/crypto.dart';
void main() {
var passwordBytes = utf8.encode("s0me-super-cool-p@$$WorD-here");
var passwordEncrypt = sha256.convert(passwordBytes);
print("Digest as bytes: ${passwordEncrypt.bytes}");
print("Digest as bytes: ${passwordEncrypt}");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment