Skip to content
pubscout

xor_dart

1.0.2, released 4 years ago by an unverified publisher

Simple XOR symmetric encryption and decryption library with or without a secret key.

WASM-ready
$ flutter pub add xor_dart
Source repository

What it does

Provides a pure Dart library for simple XOR symmetric encryption and decryption. Supports operations with a secret key or static methods for byte arrays, base64 strings, and file processing.

AI-written summary of version 1.0.2, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need lightweight obfuscation or basic XOR encryption in Dart
  • You want to encrypt or decrypt files or byte streams using XOR

Skip it when

  • You require strong cryptographic security (XOR is easily broken)
  • You need standard modern encryption algorithms like AES or RSA

Strengths

  • Pure Dart implementation with no external dependencies
  • Supports both secret-key and keyless XOR operations
  • Convenience methods for base64 strings and files

Weaknesses

  • XOR cipher is cryptographically weak and unsuitable for sensitive data
  • No built-in modern cryptographic features

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
0
import 'package:xor_dart/xor_dart.dart';

void main() {
  var xor = Xor('_a_random_key_');
  var plain = 'You are so handsome!';
  var encode = xor.encode(plain);
  var decode = xor.decode(encode);
  print('>>> decrypted correct: ${plain == decode}');
}

Alternatives

Packages that do the same job and could replace xor_dart.

  • crypto

    Provides standard cryptographic hash functions and tools if you need more robust security utilities.