Re:Simple XMPP command line client
by kova12 on Sunday February 13, 2022 @11:51AM
(#30323121)
It would be valuable if there was a CLI xmpp tool which could also encrypt... Then it could be used in home automation projects
[ Parent
| on HN ]
Meant to reply with this here and not on the child comment, but either way here is something truly bad you can start with that may meet some of your needs: https://github.com/gatlin/valet
If you make it less bad I will accept any PRs!
Re:Simple XMPP command line client
by matthias_hmb on Sunday February 13, 2022 @12:28PM
(#30323502)
Yes, I would like too... and I see that OMEMO seems to be the current and best protocol for xmpp. But I found only one library and the implementation in profanity. I'm not a crypto guy and I don't understand it, so if there is a simple way to add it (as optional) compile dependency, I will do. But messing up with crypto doesn't sound like a good way to go.
In mcabber is the option to send commands with a fifo, so it would be possible to send (GPG and OTR) encrypted messages. With profanity, it might be possible by writing a plugin.
This is really bad code that I encourage you to fix (and maybe submit a PR? :): https://github.com/gatlin/valet
Re:Simple XMPP command line client
by matthias_hmb on Monday February 14, 2022 @01:44AM
(#30328994)
I just realized, depending on the project, if both sides use that txmppc, any encryption (age, gpg) would work (not with other xmpp client compatible):
sender: echo "m CRYPT:encrypted_message" | txmppc
receiver: txmppc | while read line; do crypt = "${line#*CRYPT:}"; if [ "$line" != "$crypt" ]; then echo "$crypt" | decrypt; else echo "$line"; fi; done
I understand you can encrypt the message with gpg2 and then send the message with the CLI (perl based) script sendxmpp [1].
Re:Simple XMPP command line client
by matthias_hmb on Monday February 14, 2022 @01:36AM
(#30328965)
Thanks for that hint.
I added command 'r' to send a raw stanza, so a script would work like this:
BASE64_OPENPGP_MESSAGE=$(echo "message" | gpg | b64)"
echo "r <message to='[email protected]'><openpgp xmlns='urn:xmpp:openpgp:0'>${BASE64_OPENPGP_MESSAGE}</openpgp></message>" | txmppc