Publish and Subscribe to AES-256 Encrypted MQTT Messages to Node-RED from PHP Scripts
Various Node-Red crypto modules do not work with PHP, so to send an encrypted message from a PHP script (in this case from a Ubuntu server) to Node-RED we need our own code.
After a few hours of searching, testing various libs, more testing and debugging, I got this PHP to Node-RED code working today, and it works OK (serves its purpose):
The "crypto" lib is included in the current version of Node-RED, so they say, but it did not work for me until imported it into Node-RED as follows (maybe I did something wrong earlier when debugging):
But that is not enough, you need to edit / add to your settings.js file in your Node-RED base directory, like this:
Then we can write a JS function node in Node-RED, as follows:
My debugging layout looks like this in Node-RED:
Node-RED Debug Console Results:
With this example PHP and Node-JS JS function code, we can publish (encrypting on the PHP side) and subscribe (decrypting on the Node-RED side) any Linux server data we wish to Node-RED using PHP, securely with AES-256 encryption.
Experts,
I am trying to encrypt my filesystem using the AES 256 bit type of encryption. I am using FreeBSD 5.4 and need to encrypt one of the mounted points. Does anybody have any good idea of how to do it?
Is there any documentation about encrypting the disk partition as this method is more... (2 Replies)
1. we are a group a students and we need a help for sending encrypted messages with unix (ssh or scp)
2. we tried to use ssh and scp protocol but we didn't manage to send the message because we don't know the correct syntax of the command and we are asked a password and we don't know which is... (1 Reply)
Hello community,
I created a script to simply query DB and then analize data. The environment where the script will works is two RedHat machines that access both to an external database. My script runs from the first crontab node. But what about if the first node goes down?
What I need is copy... (2 Replies)
Toucan software uses 256bit AES encryption using ccrypt (https://en.wikipedia.org/wiki/Ccrypt)
i want to ask if its secure to use this ccrypt encryption for storing .TXT file with my passwords on cloud storage like Google Drive? (7 Replies)
Hello,
I have been searching for some advice on this.
I'm new to linux in a sys-admin kind of role, and I'm often asked to get information by running basic commands in the linux shell. For example, how many jobs running, grep a number of files, run a random program and output the results,... (4 Replies)
Here we go....
Preface:
..... so in a galaxy far, far, far away from commercial, data sharing corporations.....
For this project, I used the ESP-WROOM-32 as an MQTT (publish / subscribe) client which receives Linux server "load averages" as messages published as MQTT pub/sub messages.... (6 Replies)
After setting up MQTT and testing some ESP8266 and ESP32 modules, where I noted that testing in Programming ESP32 (ESP-WROOM-32) as an MQTT Client Subscribed to Linux Server Load Average Messages, I was so impressed with MQTT that I installed MQTT on three different computers, instantly and... (2 Replies)
First, I want to thank Neo (LOL) for this post from 2018, Node.js and mysql - ER_ACCESS_DENIED_ERROR
I could not get the Node-RED mysql module to work and searched Google until all my links were purple! I kept getting ER_ACCESS_DENIED_ERROR with the right credentials. Nothing on the web was... (0 Replies)