Get encrypted data

HI guys,

i want to push the crypted data to my web page but i don’t now how to do, i can push the decrypted data with http integration but how about the crypted data ?

1 Like

I assume you mean encrypted data. As you already have the decrypted data, why would you like to also have the encrypted data? Could you share your use-case?

Thank you for your answer,
yes the encrypted data, I work on a project that analyzes lora trams and detects if they are corpulent or not, but before doing all that, I have to receive the data on my application, like http integration but with encrypted data !

@brocaar can you help me please ?

Hello,
We do this analyse at the gateway bridge level. We listen messages on the mqtt between GW bridge and NS.
We can do analyse on encrypted payload :slight_smile:

Yes i know ! but how we can send this encrypted data to end application from gateway bridge?

You have multiple solution, develop a small application who reed gateway bridge messages and send them to your application.
Or you can use an ETL tool. We are trying telegraf, who can reed json/MQTT and push data to multiple outpus. If you want to avoid a developement you can try this solution.

hi everybody,

I share with you my work, script in python that respons at 100% of this subject :slight_smile:

import paho.mqtt.client as mqtt #import the client1
import time
import json
import requests

#phy = “” #phypayload extrait de la tram

#------------------------------------------------------------------------------------------------
def trame_analyse(a):

      i=0
      j=0
      while i < len(a): # BOUCLE DE TRAITEMENT DE CHAINE DE CARACTÉRES
                 
           if a[i:i+10] == "phyPayload":
             global phy
             phy = a[i+13:len(a)-2]
             
           else :
             k=0   

           i += 1

#------------------------------------------------------------------------------------------------
def on_log(client, userdata, level, buf) :
#print("log: "+buf)
k=0
#------------------------------------------------------------------------------------------------
def on_connect(client, userdata, flags, rc) :
if rc==0:
print(“connected ok”)
else:
print(“not connected”, rc)
#------------------------------------------------------------------------------------------------
def on_disconnect(client, userdata, flags, rc=0) :
print("disconnect result code "+str(rc))
#------------------------------------------------------------------------------------------------
def on_message(client,userdata,msg) :
global m_decode
topic=msg.topic
m_decode=str(msg.payload.decode(“utf-8”,“ignore”))
trame_analyse(m_decode)
time.sleep(2)

   print("message received :  ",m_decode)
   print('')
   print("send to paclido server")
   print('')
   print("PHYPAYLOAD",phy)
   
   encrypt = {"data_enc":phy}
   resp = requests.post('http://**********', data = encrypt)

#------------------------------------------------------------------------------------------------

broker_address=“127.0.0.1:1883”

client = mqtt.Client(“p”) #create new instance

client.on_connect=on_connect
client.on_disconnect=on_disconnect
client.on_log=on_log
client.on_message=on_message

print (“cnct to broker”, broker_address)
client.connect(“127.0.0.1”, 1883, 60)
client.subscribe(“gateway/***********/tx”)
client.loop_forever()

i hope that will help you :slight_smile: