What's the best way to go about encrypting data for my Flask app?

Linode Staff

I am running a simple Flask app where I'm planning to add some more functionality soon. I will be using the Flask Mail extension where I need to use some email passwords to get it working. I see some people suggest adding secret keys in environment variables, others say this is not a safe way. Any advice?

1 Reply

Linode Staff

Hey there! I can't say I'm a Flask aficionado either, so I had a bit of digging to do in order to put together what I think should be a good starting point. I'll go ahead and list the resources I utilized at below, starting with what I found to be the most helpful:

From what I've gathered, you can hash your users' passwords before storing them in your database, process requests against tokens, store keys either as environment variables or locally, or any combination of these methods.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct