vernam_cipher

Creator: coderz1093

Last updated:

0 purchases

TODO
Add to Cart

Description:

vernam cipher

Dart implementation of Vernam Cipher.
Usage #
var vernam = vernamCipher(); // optional key
var encoded = vernam.encode(utf8.encode('This is example.'));
var cleartext = vernam.decode(encoded);
copied to clipboard
Encryption and decryption in the form of streams:
final enStream =
Stream.value(utf8.encode('This is example.')).transform(vernam.encoder);

var output = File('path/to/file').openWrite();
await output.addStream(enStream);
output.close();

var input = File('path/to/file').openRead();
var cleartext = await input
.transform(vernam.decoder)
.transform(utf8.decoder)
.fold(StringBuffer(),
(StringBuffer buffer, String string) => buffer..write(string))
.then((StringBuffer buffer) => buffer.toString());
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.