Search packages, repositories and app categories

Package detailsv0.1.2

sasl_scram

A Package providing sasl/scram authentication. Both scram-1 and scram-256 are managed.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
134K
Likes
4
Pub points
150

Install package

flutter pub add sasl_scram

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The sasl_scram package provides implementation of SASL SCRAM authentication mechanisms, supporting both SCRAM-SHA-1 and SCRAM-SHA-256. It enables secure password-based authentication for protocols requiring SASL, such as MongoDB or other services using SCRAM. The package is designed for cross-platform use and integrates seamlessly into Flutter applications on Android, iOS, Web, macOS, Windows, and Linux. It handles cryptographic operations securely and follows standard SCRAM protocol specifications.

Use cases

  • Secure authentication in database connections
  • Implementing SCRAM-based login systems
  • Integrating with services requiring SASL authentication
  • Cross-platform secure credential handling
  • Supporting modern password-based authentication protocols

Key features

  • Supports SCRAM-SHA-1 and SCRAM-SHA-256
  • Cross-platform compatibility
  • Secure cryptographic implementation
  • Standard-compliant SASL SCRAM
  • Lightweight and easy to integrate

Suitable for

  • Developers building secure backend integrations
  • Applications requiring SCRAM authentication
  • Flutter apps needing secure login workflows
  • Projects using MongoDB or similar databases
  • Teams prioritizing protocol-standard security

Considerations

  • Requires understanding of SASL and SCRAM protocols
  • Not suitable for non-authentication use cases
  • Depends on underlying Dart crypto implementations
  • Limited to SCRAM variants, not other SASL mechanisms
  • Must be used with compatible server-side authentication

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Sasl Scram for Dart

Implementation of the Salted Challenge Response Authentication Mechanism in Dart.

Usage

A simple usage example:

import 'dart:typed_data';

import 'package:crypto/crypto.dart';
import 'package:sasl_scram/sasl_scram.dart';

void main() {
  final bytesReceivedFromServer = Uint8List(0); // No data needed when starting authentication

  final authenticator = ScramAuthenticator(
    'SCRAM-SHA-256', // Optionally choose hash method from a list provided by the server
    sha256,
    UsernamePasswordCredential(username: 'dart', password: 'dart'),
  );

  final bytesToSentToServer = authenticator.handleMessage(
    SaslMessageType.AuthenticationSASL, // Get type type from the server message
    bytesReceivedFromServer, // Append the remaining bytes
  );
  print(bytesToSentToServer); // Wrap these bytes with your message which goes back to the server
}

Features and bugs

Please file feature requests and bugs at the issue tracker.

Categories

Dependencies

Dependency list 4 items

Source repository

Projects using this package

Rankings