Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

You are destined to become the commandant of the fighting men of the department of transportation.


sci / sci.crypt / Re: XChaCha20 Python3 CLI tool

SubjectAuthor
* XChaCha20 Python3 CLI toolStefan Claas
+* Re: XChaCha20 Python3 CLI toolStefan Claas
|`* Re: XChaCha20 Python3 CLI toolStefan Claas
| `- Re: XChaCha20 Python3 CLI toolStefan Claas
`* Re: XChaCha20 Python3 CLI toolPhil Carmody
 `* Re: XChaCha20 Python3 CLI toolStefan Claas
  `- Re: XChaCha20 Python3 CLI toolStefan Claas

1
Subject: XChaCha20 Python3 CLI tool
From: Stefan Claas
Newsgroups: sci.crypt
Organization: Ch1ffr3punk5
Date: Sun, 8 Sep 2024 17:31 UTC
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!i2pn.org!i2pn2.org!.POSTED!not-for-mail
From: pollux@tilde.club (Stefan Claas)
Newsgroups: sci.crypt
Subject: XChaCha20 Python3 CLI tool
Date: Sun, 8 Sep 2024 17:31:34 -0000
Organization: Ch1ffr3punk5
Message-ID: <89f2389309ef1efcee726c83b77588c1556e289d@i2pn2.org>
MIME-Version: 1.0
Injection-Date: Sun, 8 Sep 2024 17:31:57 -0000 (UTC)
Injection-Info: i2pn2.org;
logging-data="1321608"; mail-complaints-to="usenet@i2pn2.org";
posting-account="ieSrCjSDShpZNyqIW52mlwIkg76Hsp+TOOO6KTdfCN8";
User-Agent: flnews/1.3.0pre11 (for GNU/Linux)
Cancel-Lock: sha256:vCxbbTE6fHeUviB1GqhEzbslGDGLS3wGYcZfOgl/LAg=
X-Ed25519-Sig: 9c72d1133274c60d5a0a847bd53b355e3ab27f7f8e90daf5aed65685dec56837
f92a4c9d84a4be5dcb0191f285ad9af85632c97a1a6bb1e2f8a094eea975fb09
X-Spam-Checker-Version: SpamAssassin 4.0.0
X-Date: It's Sun 11331 Sep 1993 07:31:34 PM CEST, the September that never ends
X-Ed25519-Pub: c0ffee5a36e581eb10f60b2831b3cdb955d2e7ef680dd282a8d43ad8b84b357a
View all headers

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

The program reads from stdin and writes to stdout. Use input/output redirection for files.

Examples:
Encryption: ./xchacha20.py key.hex nonce.hex < plaintext.txt > encrypted.bin
Decryption: ./xchacha20.py key.hex nonce.hex < encrypted.bin > decrypted.txt

Note: The key should be 32 hex bytes (64 characters) long.
The nonce should be 24 hex bytes (48 characters) long.

IyEvdXNyL2Jpbi9lbnYgcHl0aG9uMwoKaW1wb3J0IHN5cwppbXBvcnQgb3MKZnJvbSBDcnlwdG8u
Q2lwaGVyIGltcG9ydCBDaGFDaGEyMAoKZGVmIHJlYWRfaGV4X2ZpbGUoZmlsZW5hbWUpOgogICAg
d2l0aCBvcGVuKGZpbGVuYW1lLCAncicpIGFzIGY6CiAgICAgICAgaGV4X3N0cmluZyA9IGYucmVh
ZCgpLnN0cmlwKCkKICAgIHJldHVybiBieXRlcy5mcm9taGV4KGhleF9zdHJpbmcpCgpkZWYgcHJp
bnRfdXNhZ2UoKToKICAgIHByaW50KGYiIiJVc2FnZToge3N5cy5hcmd2WzBdfSA8a2V5ZmlsZT4g
PG5vbmNlZmlsZT4gPCBpbmZpbGUgPiBvdXRmaWxlCgpYQ2hhQ2hhMjAgZW5jcnlwdGlvbi9kZWNy
eXB0aW9uIHRvb2wKCkFyZ3VtZW50czoKICBrZXlmaWxlICAgIFBhdGggdG8gdGhlIGZpbGUgY29u
dGFpbmluZyB0aGUga2V5IGluIGhleGFkZWNpbWFsIGZvcm1hdAogIG5vbmNlZmlsZSAgUGF0aCB0
byB0aGUgZmlsZSBjb250YWluaW5nIHRoZSBub25jZSBpbiBoZXhhZGVjaW1hbCBmb3JtYXQKClRo
ZSBwcm9ncmFtIHJlYWRzIGZyb20gc3RkaW4gYW5kIHdyaXRlcyB0byBzdGRvdXQuIFVzZSBpbnB1
dC9vdXRwdXQgcmVkaXJlY3Rpb24gZm9yIGZpbGVzLgoKRXhhbXBsZXM6CiAgRW5jcnlwdGlvbjog
e3N5cy5hcmd2WzBdfSBrZXkuaGV4IG5vbmNlLmhleCA8IHBsYWludGV4dC50eHQgPiBlbmNyeXB0
ZWQuYmluCiAgRGVjcnlwdGlvbjoge3N5cy5hcmd2WzBdfSBrZXkuaGV4IG5vbmNlLmhleCA8IGVu
Y3J5cHRlZC5iaW4gPiBkZWNyeXB0ZWQudHh0CgpOb3RlOiBUaGUga2V5IHNob3VsZCBiZSAzMiBo
ZXggYnl0ZXMgKDY0IGNoYXJhY3RlcnMpIGxvbmcuCiAgICAgIFRoZSBub25jZSBzaG91bGQgYmUg
MjQgaGV4IGJ5dGVzICg0OCBjaGFyYWN0ZXJzKSBsb25nLgoiIiIsIGZpbGU9c3lzLnN0ZGVycikK
CmRlZiBtYWluKCk6CiAgICBpZiBsZW4oc3lzLmFyZ3YpICE9IDM6CiAgICAgICAgcHJpbnQoIkVy
cm9yOiBJbmNvcnJlY3QgbnVtYmVyIG9mIGFyZ3VtZW50cyIsIGZpbGU9c3lzLnN0ZGVycikKICAg
ICAgICBwcmludF91c2FnZSgpCiAgICAgICAgc3lzLmV4aXQoMSkKCiAgICBrZXlfZmlsZSA9IHN5
cy5hcmd2WzFdCiAgICBub25jZV9maWxlID0gc3lzLmFyZ3ZbMl0KCiAgICB0cnk6CiAgICAgICAg
a2V5ID0gcmVhZF9oZXhfZmlsZShrZXlfZmlsZSkKICAgIGV4Y2VwdCBFeGNlcHRpb24gYXMgZToK
ICAgICAgICBwcmludChmIkVycm9yIHJlYWRpbmcga2V5IGZpbGU6IHtlfSIsIGZpbGU9c3lzLnN0
ZGVycikKICAgICAgICBzeXMuZXhpdCgxKQoKICAgIHRyeToKICAgICAgICBub25jZSA9IHJlYWRf
aGV4X2ZpbGUobm9uY2VfZmlsZSkKICAgIGV4Y2VwdCBFeGNlcHRpb24gYXMgZToKICAgICAgICBw
cmludChmIkVycm9yIHJlYWRpbmcgbm9uY2UgZmlsZToge2V9IiwgZmlsZT1zeXMuc3RkZXJyKQog
ICAgICAgIHN5cy5leGl0KDEpCgogICAgaWYgbGVuKGtleSkgIT0gMzI6CiAgICAgICAgcHJpbnQo
ZiJFcnJvcjogSW52YWxpZCBrZXkgc2l6ZS4gRXhwZWN0ZWQgMzIgaGV4IGJ5dGVzLCBnb3Qge2xl
bihrZXkpfSBieXRlcyIsIGZpbGU9c3lzLnN0ZGVycikKICAgICAgICBzeXMuZXhpdCgxKQoKICAg
IGlmIGxlbihub25jZSkgIT0gMjQ6CiAgICAgICAgcHJpbnQoZiJFcnJvcjogSW52YWxpZCBub25j
ZSBzaXplLiBFeHBlY3RlZCAyNCBoZXggYnl0ZXMsIGdvdCB7bGVuKG5vbmNlKX0gYnl0ZXMiLCBm
aWxlPXN5cy5zdGRlcnIpCiAgICAgICAgc3lzLmV4aXQoMSkKCiAgICBjaXBoZXIgPSBDaGFDaGEy
MC5uZXcoa2V5PWtleSwgbm9uY2U9bm9uY2UpCgogICAgd2hpbGUgVHJ1ZToKICAgICAgICBjaHVu
ayA9IHN5cy5zdGRpbi5idWZmZXIucmVhZCg4MTkyKQogICAgICAgIGlmIG5vdCBjaHVuazoKICAg
ICAgICAgICAgYnJlYWsKICAgICAgICBzeXMuc3Rkb3V0LmJ1ZmZlci53cml0ZShjaXBoZXIuZW5j
cnlwdChjaHVuaykpCgppZiBfX25hbWVfXyA9PSAiX19tYWluX18iOgogICAgbWFpbigpCg==

$ openssl rand -hex 32 > key
$ openssl rand -hex 24 > nonce
$ echo -n 'Hello World!' | xchacha20 key nonce | hexdump -Cv
00000000 01 eb 7f 2e d5 e9 a4 e0 c8 e4 e2 d6 |............|
0000000c

--
Regards
Stefan

Subject: Re: XChaCha20 Python3 CLI tool
From: Stefan Claas
Newsgroups: sci.crypt
Organization: Ch1ffr3punk5
Date: Sun, 8 Sep 2024 17:48 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!i2pn.org!i2pn2.org!.POSTED!not-for-mail
From: pollux@tilde.club (Stefan Claas)
Newsgroups: sci.crypt
Subject: Re: XChaCha20 Python3 CLI tool
Date: Sun, 8 Sep 2024 17:48:25 -0000
Organization: Ch1ffr3punk5
Message-ID: <7c14f2576f9ae75d449a68e666439db2fb38e7d0@i2pn2.org>
References: <89f2389309ef1efcee726c83b77588c1556e289d@i2pn2.org>
MIME-Version: 1.0
Injection-Date: Sun, 8 Sep 2024 17:48:48 -0000 (UTC)
Injection-Info: i2pn2.org;
logging-data="1323111"; mail-complaints-to="usenet@i2pn2.org";
posting-account="ieSrCjSDShpZNyqIW52mlwIkg76Hsp+TOOO6KTdfCN8";
User-Agent: flnews/1.3.0pre11 (for GNU/Linux)
Cancel-Lock: sha256:dogw49ULV8O4L8x09YLWdvsyxzCIcId/nje87Q8znco=
X-Ed25519-Sig: 3f6c1fb73f14a39499b6080e3d4dd57530b1d072a639ad4abd219894753287f4
81cea92b1dfa3664e3854e16f598034dd0a679ad778bbf03c0591b3abf81140a
X-Ed25519-Pub: c0ffee5a36e581eb10f60b2831b3cdb955d2e7ef680dd282a8d43ad8b84b357a
X-Spam-Checker-Version: SpamAssassin 4.0.0
X-Date: It's Sun 11331 Sep 1993 07:48:25 PM CEST, the September that never ends
View all headers

Stefan Claas wrote:
>
> 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.

Forgot to mention:

pip3 install pycryptodome

--
Regards
Stefan

Subject: Re: XChaCha20 Python3 CLI tool
From: Stefan Claas
Newsgroups: sci.crypt
Organization: Ch1ffr3punk5
Date: Sun, 8 Sep 2024 18:54 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!i2pn.org!i2pn2.org!.POSTED!not-for-mail
From: pollux@tilde.club (Stefan Claas)
Newsgroups: sci.crypt
Subject: Re: XChaCha20 Python3 CLI tool
Date: Sun, 8 Sep 2024 18:54:28 -0000
Organization: Ch1ffr3punk5
Message-ID: <5bcab70e0e9baa3346bf2fd4b87c2b43f8ef9b37@i2pn2.org>
References: <89f2389309ef1efcee726c83b77588c1556e289d@i2pn2.org> <7c14f2576f9ae75d449a68e666439db2fb38e7d0@i2pn2.org>
MIME-Version: 1.0
Injection-Date: Sun, 8 Sep 2024 18:54:28 -0000 (UTC)
Injection-Info: i2pn2.org;
logging-data="1328629"; mail-complaints-to="usenet@i2pn2.org";
posting-account="ieSrCjSDShpZNyqIW52mlwIkg76Hsp+TOOO6KTdfCN8";
User-Agent: flnews/1.3.0pre11 (for GNU/Linux)
Cancel-Lock: sha256:32j4KLbePMfRmgJ0I22bN3wYVVS20tqk2gV5zL1ZuFg=
X-Ed25519-Pub: c0ffee5a36e581eb10f60b2831b3cdb955d2e7ef680dd282a8d43ad8b84b357a
X-Ed25519-Sig: e68680076e5adb04ccdb9384ad829cb2fb3b0a3445bbca2ded4631802f6e33f4
10d483872c49c4704b144713cc39d2678ed998fc14e15f974d60701cefac740b
X-Spam-Checker-Version: SpamAssassin 4.0.0
X-Date: It's Sun 11331 Sep 1993 08:54:28 PM CEST, the September that never ends
View all headers

Stefan Claas wrote:
> Stefan Claas wrote:
> >
> > 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.

Just for fun :-):

$ echo -n 'Test' | xchacha20 key nonce | armor
-----BEGIN PGP MESSAGE-----

eQyt7Q==
=yEnM
-----END PGP MESSAGE-----

--
Regards
Stefan

Subject: Re: XChaCha20 Python3 CLI tool
From: Stefan Claas
Newsgroups: sci.crypt
Organization: Ch1ffr3punk5
Date: Sun, 8 Sep 2024 19:03 UTC
References: 1 2 3
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!i2pn.org!i2pn2.org!.POSTED!not-for-mail
From: pollux@tilde.club (Stefan Claas)
Newsgroups: sci.crypt
Subject: Re: XChaCha20 Python3 CLI tool
Date: Sun, 8 Sep 2024 19:03:11 -0000
Organization: Ch1ffr3punk5
Message-ID: <2b2874b97d01c3c18231f11a124309dfc7564cee@i2pn2.org>
References: <89f2389309ef1efcee726c83b77588c1556e289d@i2pn2.org> <7c14f2576f9ae75d449a68e666439db2fb38e7d0@i2pn2.org> <5bcab70e0e9baa3346bf2fd4b87c2b43f8ef9b37@i2pn2.org>
MIME-Version: 1.0
Injection-Date: Sun, 8 Sep 2024 19:03:33 -0000 (UTC)
Injection-Info: i2pn2.org;
logging-data="1329806"; mail-complaints-to="usenet@i2pn2.org";
posting-account="ieSrCjSDShpZNyqIW52mlwIkg76Hsp+TOOO6KTdfCN8";
User-Agent: flnews/1.3.0pre11 (for GNU/Linux)
Cancel-Lock: sha256:LJcqjA63OhUMCpMnDwvSTOoFwdUvbsCMRhsgh9hGpzA=
X-Ed25519-Pub: c0ffee5a36e581eb10f60b2831b3cdb955d2e7ef680dd282a8d43ad8b84b357a
X-Date: It's Sun 11331 Sep 1993 09:03:11 PM CEST, the September that never ends
X-Ed25519-Sig: ab332ca6a314d5930b26befc862b5ed8c14f5c7bd2f3b0a8051b949f4e3498d5
e74830cf38dcdfbfea7126b139e81924542749d14ddaa3f12d99e29e930e5b0e
X-Spam-Checker-Version: SpamAssassin 4.0.0
View all headers

Stefan Claas wrote:
> Stefan Claas wrote:
> > Stefan Claas wrote:
> > >
> > > 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.
>
> Just for fun :-):
>
> $ echo -n 'Test' | xchacha20 key nonce | armor
> -----BEGIN PGP MESSAGE-----
>
> eQyt7Q==
> =yEnM
> -----END PGP MESSAGE-----
>

And a padded SMS in two fiver groups, for easy and error
free typing and reading with a dumb phone. :-)

$ echo -n 'Test' | mp | xchacha20 key nonce2 | az | ug -g
Data successfully padded.
Original size: 4 bytes
Padded size: 5 bytes
OCMOM PCSKG

--
Regards
Stefan

Subject: Re: XChaCha20 Python3 CLI tool
From: Phil Carmody
Newsgroups: sci.crypt
Organization: A noiseless patient Spider
Date: Mon, 7 Oct 2024 14:17 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: pc+usenet@asdf.org (Phil Carmody)
Newsgroups: sci.crypt
Subject: Re: XChaCha20 Python3 CLI tool
Date: Mon, 07 Oct 2024 17:17:02 +0300
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <87v7y4dmld.fsf@fatphil.org>
References: <89f2389309ef1efcee726c83b77588c1556e289d@i2pn2.org>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Mon, 07 Oct 2024 16:17:03 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="e949208cab0c66733a27940ba3f97ac0";
logging-data="1843748"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+p3VqGEf2Esp0hdvDM9Q6M"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:M+B9GBqV2ZpSxZVkhzfySdagzV8=
sha1:bjjtTEVVgrbnCYaQZR95OLhKuFc=
View all headers

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?

Phil
--
We are no longer hunters and nomads. No longer awed and frightened, as we have
gained some understanding of the world in which we live. As such, we can cast
aside childish remnants from the dawn of our civilization.
-- NotSanguine on SoylentNews, after Eugen Weber in /The Western Tradition/

Subject: Re: XChaCha20 Python3 CLI tool
From: Stefan Claas
Newsgroups: sci.crypt
Organization: Ch1ffr3punk5
Date: Mon, 7 Oct 2024 16:22 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!i2pn.org!i2pn2.org!.POSTED!not-for-mail
From: pollux@tilde.club (Stefan Claas)
Newsgroups: sci.crypt
Subject: Re: XChaCha20 Python3 CLI tool
Date: Mon, 7 Oct 2024 16:22:08 -0000
Organization: Ch1ffr3punk5
Message-ID: <df494c5bc2199a89f9302a99fe61478b9751c0db@i2pn2.org>
References: <89f2389309ef1efcee726c83b77588c1556e289d@i2pn2.org> <87v7y4dmld.fsf@fatphil.org>
MIME-Version: 1.0
Injection-Date: Mon, 7 Oct 2024 16:22:09 -0000 (UTC)
Injection-Info: i2pn2.org;
logging-data="987583"; mail-complaints-to="usenet@i2pn2.org";
posting-account="ieSrCjSDShpZNyqIW52mlwIkg76Hsp+TOOO6KTdfCN8";
User-Agent: flnews/1.3.0pre11 (for GNU/Linux)
Cancel-Lock: sha256:iaysogE3Nb65kSIqqGOUDlAiS+WvyDYGfvtwEoSs1AA=
X-Ed25519-Sig: f6bc20d21ecad30d4ff0f9a52950c5455e5a22ae74ce682bfde8ea1cddf5d3f0
7bbab993dacc1f178e6ecd95f7c06ebb22196abd6548a19f6769ef8e6e6b550d
X-Date: It's Mon 11360 Sep 1993 06:22:08 PM CEST, the September that never ends
X-Ed25519-Pub: c0ffee5a36e581eb10f60b2831b3cdb955d2e7ef680dd282a8d43ad8b84b357a
X-Spam-Checker-Version: SpamAssassin 4.0.0
View all headers

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

--
Regards
Stefan

Subject: Re: XChaCha20 Python3 CLI tool
From: Stefan Claas
Newsgroups: sci.crypt
Organization: To protect and to server
Date: Tue, 14 Jan 2025 14:12 UTC
References: 1 2 3
Path: news.eternal-september.org!eternal-september.org!feeder3.eternal-september.org!newsfeed.bofh.team!paganini.bofh.team!not-for-mail
From: fgrsna.pynnf@vagrearg.eh (Stefan Claas)
Newsgroups: sci.crypt
Subject: Re: XChaCha20 Python3 CLI tool
Date: Tue, 14 Jan 2025 15:12:51 +0100
Organization: To protect and to server
Message-ID: <vm5rdj$3cl4n$1@paganini.bofh.team>
References: <89f2389309ef1efcee726c83b77588c1556e289d@i2pn2.org> <87v7y4dmld.fsf@fatphil.org> <df494c5bc2199a89f9302a99fe61478b9751c0db@i2pn2.org>
Mime-Version: 1.0
Injection-Date: Tue, 14 Jan 2025 14:13:07 -0000 (UTC)
Injection-Info: paganini.bofh.team; logging-data="3560599"; posting-host="L/rT7uqiVZTQB03TSsYlcw.user.paganini.bofh.team"; mail-complaints-to="usenet@bofh.team"; posting-account="9dIQLXBM7WM9KzA+yjdR4A";
User-Agent: flnews/1.3.0pre29 (for GNU/Linux)
Cancel-Lock: sha1:DBK1NTR1Wun6Z/h1VGO9t1LwDDg=
X-Date: It's Tue Sep 11459 03:12:51 PM CET 1993, the September that never ends.
X-Notice: Filtered by postfilter v. 0.9.3
X-Ed25519-Pub: c0ffee5a36e581eb10f60b2831b3cdb955d2e7ef680dd282a8d43ad8b84b357a
X-Ed25519-Sig: 9ebd396d4bc75d5674250bf376f185980c57ffca5ca16c5dff7b675984fe26d0
a314ac7b2a0a524ad5fee011225f23d432ea1118fe9ec7d75b6dc904eed7030b
View all headers

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/xchacha20
https://github.com/706f6c6c7578/pwgen
https://www.yubico.com/products/yubico-authenticator/

--
Regards
Stefan

1

rocksolid light 0.9.8
clearnet tor