Sujet : Re: XChaCha20 Python3 CLI tool
De : fgrsna.pynnf (at) *nospam* vagrearg.eh (Stefan Claas)
Groupes : sci.cryptDate : 14. Jan 2025, 15:12:51
Autres entêtes
Organisation : To protect and to server
Message-ID : <vm5rdj$3cl4n$1@paganini.bofh.team>
References : 1 2 3
User-Agent : flnews/1.3.0pre29 (for GNU/Linux)
Stefan Claas wrote:
Phil Carmody wrote:
Stefan Claas <pollux@tilde.club> writes:
Hi all,
DJB's XChaCha20 stream cipher is pretty cool for Text messages (SMS),
if you have also a proper encoder for the binary output.
So I decided to convert my Go Code to Python3.
Here is the program to play with, base64 encoded.
$ ./xchacha20.py
Error: Incorrect number of arguments
Usage: ./xchacha20.py <keyfile> <noncefile> < infile > outfile
XChaCha20 encryption/decryption tool
Arguments:
keyfile Path to the file containing the key in hexadecimal format
noncefile Path to the file containing the nonce in hexadecimal format
Why is the nonce in a file - are you planning on using it multiple
times?
I always use nonces from files and for each message a new one. I have
my nonce rachtet program 'nora' which calculates them, without needing
to transfer them.
https://github.com/706f6c6c7578/nora
xchacha20.go is updated, so that you can input the password and nonce
in the shell, with -p and -s parameter. I did this because now I have
also pwgen.go which uses the TPM 2.0 hardware TRNG.
This is pretty cool IMHO, becaue you generate the password for xchacha20.go
with pwgen.go, put it with Yubikey Authenticator on Slot 2 of your Yubikey
and friends Yubikeys and no longer need to type it in, because you simply
press the button. :-)
https://github.com/706f6c6c7578/xchacha20https://github.com/706f6c6c7578/pwgenhttps://www.yubico.com/products/yubico-authenticator/-- RegardsStefan