Lokdon Encryption and Decryption Package
Dart plugin for Lokdon SDK
Check this Demo Project or this Video Demo to gain more clarity
Getting Started
In the pubspec.yaml
of your flutter or dart project, add the following dependency:
dependencies:
...
lokdon_sdk: ^1.0.4
Run:
flutter pub get
Import it:
import 'package:lokdon_sdk/lokdon_sdk.dart';
Usage
Encrypt on a String input
To Encrypt a string, use the encryptData
function
import 'package:lokdon_sdk/lokdon_sdk.dart';
void main() {
String data = "sample text";
var cipher = encryptData(data);
print("Cipher for data ${cipher}");
}
Decrypt on a cipher input
To decrypt a cipher encrypted using the Lokdon Algorithm, use the decryptData
function
import 'package:lokdon_sdk/lokdon_sdk.dart';
void main() {
String cipher = "Î}¯z*£^ġ:-ß";
var data = encryptData(cipher);
print("Data from cipher ${data}");
}
Encrypt and Decrypt Files
To Encrypt files, use the encryptFile function
File file = File("lok.txt");
if (!file.existsSync()){
file.createSync();
}
file.writeAsBytesSync("alexander".codeUnits);
File encryptedFile = encryptFile(file, " .", file.path);
print("encrypted File ${encryptedFile.path} ${encryptedFile.readAsStringSync()}");
//encrypted File lok.txt.lokdon ABEVA@DKR
To Decrypt an encrypte file, use the decryptFile function
File decryptedFile = decryptFile(encryptedFile, " .", file.path);
print("decrypted File ${decryptedFile.path} ${decryptedFile.readAsStringSync()}");
// decrypted File lok.txtLOKDONDECRYPTED. alexander