Submit templates for repl.it/templates here.

← Back to all posts
Private-Public repls
h
CodeLongAndPros (1591)

Sometimes you want to keep a file private but you don't have hacker. You can use this template.
So to use it, place your code in a folder named code and make a file called run.sh. This is the same as the run="" in .replit.
So for example, I can have this:

code
code/main.c
code/run.sh

where run.sh has gcc main.c -o main && ./main.
After that, create a tarball.
Go to the console and enter
tar cvf encrypted.tar.xz code
and then encrypt it:
install-pkg ccrypt
ccrypt -e encrypted.tar.xz and enter a password.
I'll use btwiusearch
Now add this to .env:
PASSWD={{{Your Password}}}
Then remove all your code:
find code -type f -exec shred -u {} +rm -rf code`
To extract your code, run:

ccrypt -d encrypted.tar.xz.cpt
tar xvf encrypted.tar.xz

This is not a fool-proof solution, because debuggers, but it makes it harder.

Comments
hotnewtop
InvisibleOne (2687)

this is the pog version of turning python code into text and putting it inside and .env and then doing print(exec(os.getenv("CODE")))

bennyrobert (47)

Didn't exactly work for me, there might be something I am missing

CodeLongAndPros (1591)

@bennyrobert what does that mean?
Can you not crypt the tarball?

bennyrobert (47)

I don't know anything, I just do what the tutorials tell me to.
@CodeLongAndPros

RayhanADev (1986)

pfffft,
imagine never having paid for hacker, yet having it for the past year

Couldn't be me

RayhanADev (1986)

@FlaminHotValdez super secret hacker code I used a promo from last october.