Skip to content
← Back to Community
Hiding a json file
Profile icon
[deleted]

i have a json file that i dont want anyone to see, how would i do that
EDIT 1: its the firebase admin sdk json file for python

Voters
Profile icon
MushyAvocado
Comments
hotnewtop
Profile icon
Andy_4sberg

If you're using a programming language that supports it on replit (example: Python), you can use replit db to store the raw json string as a dictionary. No one can see it unless you print it out to the console, or something like that.

Profile icon
robowolf

Try encryption. You can encrypt the JSON file then store in the new repl feature SECRET KEYS. Then when you're ready get it out of the key and decrypt it.

Profile icon
19ecal

You can minify the JSON down to a single line, put that into a .env file, then in your code, get it from there, parse the JSON and voilá you can use it in your code
Working python repl:
https://replit.com/@19ecal/PopularShadowyPhase#main.py

Profile icon
m4rus3ru

You might want to take a look at this:
https://docs.replit.com/repls/secret-keys

Profile icon
m4rus3ru

You will not like this, but I guess your only way to do it would be upgrading your account to 'Hacker'.
Unless you do that your repls are public.

Profile icon
LukeWright

I think the only way to hide a file in repl is either to upgrade to hacker, or rename the file ".env"

Profile icon
LukeWright

Click the check mark next to my comment if this helped! @snekattack

Profile icon
EuanTH

If you're using windows, you can hide a file by going into the properties (which is found by right clicking the file) of the file and clicking on the tick-box "Hidden".

image_2021-03-26_160954

Profile icon
[deleted]

@EuanTH im talking abount in replit