nitroglycerin v0.1.1 Nitroglycerin
A module for encrypting and decrypting the contents of an IO device, eg. a file, using a one-time pad.
Summary
Functions
Encrypts source_io
with the given pad
(a Nitroglycerin.Pad
) and outputs the encrypted bytes to the target_io
Functions
Encrypts source_io
with the given pad
(a Nitroglycerin.Pad
) and outputs the encrypted bytes to the target_io
.
both source_io
and target_io
should be IO.Stream
s that can be read and written with IO.binread
and IO.binwrite
.
Returns the number of bytes left of the pad.
Examples
> input = File.open!("input.txt")
> pad = Nitroglycerin.Pad.from_path("random.pad")
> output = File.open!("output.txt.nitro", [:write])
> Nitroglycerin.encrypt!(input, pad, output)
15643