0

I'm creating a react native app that transform audio to text.

First, a user records the audio. Then the recording is sent with RNFS.uploadFiles to flask API. This flask API I created to convert the audio file into text and send back the text to the user.

Honestly, I'm not sure how it really works. For example, I don't see the audio files that were sent from react native to flask server. They are not saved in my server (or they are?) Should I encrypt the recordings before they are sent?

I send audio with this function:

 RNFS.uploadFiles({
    toUrl: uploadUrl,
    files: fileToSend,
    method: 'POST',
    headers: {
      'Accept': 'application/json',
    }
  }).promise.then((response) => {
   setResults(response.body)
    })
    .catch((err) => {
      console.log(err)
    });
  }
}
Xenia
  • 87
  • 6
  • If you're using HTTPS, that will encrypt the traffic in-transit. Overall, the question "is this secure" is very broad; it might be best to focus on the security of a single part of this for an SO question. – Rogue Jan 30 '23 at 18:38
  • Thank you, Rogue! It means that if my server is using HTTPS, then the recordings that are sent there are encrypted? – Xenia Jan 30 '23 at 18:42

1 Answers1

0

To see the audio files sent from your application to the Flask server, you can use an HTTP Debugging tool such as Charles Proxy or Fiddler. This will show you the HTTP requests exchanged.

If your Flask server has SSL enabled (HTTPS) and your React Native is connecting through HTTPS, then the communication is already encrypted.

BayanR
  • 149
  • 9
  • I edited my question and added the code that I use to send audio. I'm not sure, if React Native is connecting through HTTPS. But my flask server has SSL enabled. – Xenia Jan 30 '23 at 18:51
  • @Xenia I don't know much about React Native but how about we prevent HTTP entirely in Flask and only allow HTTPS? https://stackoverflow.com/questions/32237379/python-flask-redirect-to-https-from-http – BayanR Jan 30 '23 at 18:53