kaalka 3.0.0 copy "kaalka: ^3.0.0" to clipboard
kaalka: ^3.0.0 copied to clipboard

Kaalka encryption algorithm for Dart. Time-based encryption for text and files using clock hand angles and trigonometric functions.

example/main.dart

import 'package:kaalka/kaalka.dart';
import 'package:kaalka/kaalka_ntp.dart';
import 'package:kaalka/packet.dart';

Future<void> main() async {
  // Basic Kaalka usage with current system time
  final kaalka = Kaalka();
  final message = 'Hello, Kaalka!';
  final encrypted = await kaalka.encrypt(message);
  final decrypted = await kaalka.decrypt(encrypted);
  print('Encrypted: $encrypted');
  print('Decrypted: $decrypted');

  // Kaalka with custom timestamp
  final customKaalka = Kaalka(time: DateTime(1970, 1, 1, 10, 15, 30));
  final encryptedCustom = await customKaalka.encrypt(message, timeKey: '10:15:30');
  final decryptedCustom = await customKaalka.decrypt(encryptedCustom, timeKey: '10:15:30');
  print('Encrypted (custom): $encryptedCustom');
  print('Decrypted (custom): $decryptedCustom');

  // KaalkaNTP async usage
  final encryptedNtp = await KaalkaNTP.encryptWithNtp(message);
  final decryptedNtp = await KaalkaNTP.decryptWithNtp(encryptedNtp);
  print('Encrypted (NTP): $encryptedNtp');
  print('Decrypted (NTP): $decryptedNtp');

  // Packet example
  final packet = Packet(message, timeKey: '12:34:56');
  await packet.encrypt();
  final decryptedPacket = await packet.decrypt();
  print('Packet decrypted: $decryptedPacket');
}
2
likes
130
points
55
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Kaalka encryption algorithm for Dart. Time-based encryption for text and files using clock hand angles and trigonometric functions.

License

unknown (license)

Dependencies

path

More

Packages that depend on kaalka