el_morro 1.0.2 copy "el_morro: ^1.0.2" to clipboard
el_morro: ^1.0.2 copied to clipboard

Solid data protection.

El Morro #

Solid data protection with no encryption overhead
100% Hecho en 🇵🇷 por Radamés J. Valentín Reyes
Orgullosamente Boricua

Features #

  • Symmetric encryption
  • No encryption overhead (file/data size is kept. not increased/bloated)
  • Easy to use
  • Ultra fast / Super lightweight
  • Data obfuscation - Bytes are shuffled. Shuffle is determined by password.

Warning #

Not compatible with previous versions. Under development. All versions are experimental. I'm just playing and seeing what happens. Don't know how to test how strong the criptographic method is. Gemini and Copilot say it is not secure.

Import Library #

import 'package:el_morro/el_morro.dart';
import 'dart:io';

Cipher bytes/data #

List<int> ciphered = cipherData(password: password, bytes: message.codeUnits);

Decipher bytes/data #

List<int> deciphered = decipherData(password: password, cipheredBytes: ciphered);

Example 1 #

Ciphering a message and then deciphering it.

int password = 1234567896545931597;
String message = "Hello World";
print("Message: $message");
List<int> ciphered = cipherData(password: password, bytes: message.codeUnits);
print("Ciphered message: ${String.fromCharCodes(ciphered)}");
List<int> deciphered = decipherData(password: password, cipheredBytes: ciphered);
print("Deciphered: ${String.fromCharCodes(deciphered)}");

Cipher File #

await cipherFile(
  password: password, 
  file: File("./test_files/text.txt"), 
  output: File("./test_files/ciphered.txt"),
);

Decipher File #

await decipherFile(
  password: password, 
  file: File("./test_files/ciphered.txt"), 
  output: File("./test_files/deciphered.txt"),
);

Example 2 #

Ciphering and deciphering a file

int password = 1234567896545931597;
await cipherFile(
  password: password, 
  file: File("./test_files/text.txt"), 
  output: File("./test_files/ciphered.txt"),
);
await decipherFile(
  password: password, 
  file: File("./test_files/ciphered.txt"), 
  output: File("./test_files/deciphered.txt"),
);

Limitations #

  • Numbers outside the range 0-255 cannot be encrypted.
  • Might not work on web because of the dart:io dependency to cipher files.

Notes #

  • Hasn't been tested for how secure it is. Use at your own risk.
0
likes
130
points
29
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Solid data protection.

License

GPL-3.0 (license)

More

Packages that depend on el_morro