Search packages, repositories and app categories

Package detailsv1.0.2

dart_des

This algorithm is a pure dart implementation of the DES and Triple DES algorithms.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
16.6K
Likes
31
Pub points
150

Install package

flutter pub add dart_des

Package Overview

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

dart_des is a pure Dart implementation of the Data Encryption Standard (DES) and Triple DES encryption algorithms. It provides secure, platform-agnostic cryptographic operations suitable for applications requiring symmetric key encryption. The package supports all major platforms including Android, iOS, Web, macOS, Windows, and Linux, making it ideal for cross-platform apps needing legacy or standardized encryption. It does not rely on native code, ensuring consistent behavior across environments. The library is designed for developers who need to implement DES-based encryption without external dependencies.

Use cases

  • Legacy system integration
  • Secure data transmission
  • Data protection in offline apps
  • Compliance with DES standards
  • Interoperability with DES-based services

Key features

  • Pure Dart implementation
  • Supports DES and Triple DES
  • Cross-platform compatibility
  • No native dependencies
  • Simple API for encryption/decryption

Suitable for

  • Developers needing DES encryption
  • Apps requiring backward compatibility
  • Projects avoiding native code
  • Security-focused Flutter applications
  • Systems using standard DES algorithms

Considerations

  • DES is considered outdated for high-security needs
  • Triple DES is slower than modern alternatives
  • Not recommended for new high-security projects
  • Requires careful key management
  • Limited to symmetric key cryptography

Original README

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

dart_des

This algorithm is a pure dart implementation of the DES and Triple DES algorithms (port of pyDES). Triple DES is either DES-EDE3 with a 24 byte key, or DES-EDE2 with a 16 byte key.

Example
import 'dart:convert';

import 'package:convert/convert.dart';
import 'package:dart_des/dart_des.dart';

main() {
  String key = '12345678'; // 8-byte
  String message = 'Driving in from the edge of town';
  List<int> encrypted;
  List<int> decrypted;
  List<int> iv = [1, 2, 3, 4, 5, 6, 7, 8];

  print('key: $key');
  print('message: $message');

  DES desECB = DES(key: key.codeUnits, mode: DESMode.ECB);
  encrypted = desECB.encrypt(message.codeUnits);
  decrypted = desECB.decrypt(encrypted);
  print('DES mode: ECB');
  print('encrypted: $encrypted');
  print('encrypted (hex): ${hex.encode(encrypted)}');
  print('encrypted (base64): ${base64.encode(encrypted)}');
  print('decrypted: $decrypted');
  print('decrypted (hex): ${hex.encode(decrypted)}');
  print('decrypted (utf8): ${utf8.decode(decrypted)}');

  key = '123456781234567812345678'; // 24-byte
  DES3 des3CBC = DES3(key: key.codeUnits, mode: DESMode.CBC, iv: iv);
  encrypted = des3CBC.encrypt(message.codeUnits);
  decrypted = des3CBC.decrypt(encrypted);
  print('Triple DES mode: CBC');
  print('encrypted: $encrypted');
  print('encrypted (hex): ${hex.encode(encrypted)}');
  print('encrypted (base64): ${base64.encode(encrypted)}');
  print('decrypted: $decrypted');
  print('decrypted (hex): ${hex.encode(decrypted)}');
  print('decrypted (utf8): ${utf8.decode(decrypted)}');
}

Categories

Source repository

Projects using this package