Share your repls and programming experiences

← Back to all posts
Encrypting text with python! (*no imports*)
h
Dart (1143)

So I was messing with base64 encryptions

and a thought came to me, "what if I tried to make this" so here is my amateur approach to cryptography by doing it manually.

or it could be a cypher idk dont yell at me

with this program you can encrypt a string and decrypt it with no imports at all! send secret messages to your friends, hide important information in plain sight, make funny comments! the possibilities are endless*

the program will also put your encryptions into text files line by line in order to so you can keep track

anyway I hope you enjoy! -Dart

* possibilities may not be endless

Comments
hotnewtop
AverseABFun (13)

d08sx8SdmIqEwb0e8Sde3q

PyCoder01 (80)

@AverseABFun this doesn't encrypt numbers and some other things

AverseABFun (13)

you don't need the else: pass lines

PyCoder01 (80)

Cool, one suggestion. Use repldb to store encrypted and decrypted text.

Dart (1143)

@PyCoder01 repldb won’t work unless it’s on a sever or you fork the repl

PyCoder01 (80)

@DartZII or a flask server that has .env and you can make requests to the server and you also have to encrypt the requests.

Dart (1143)

@PyCoder01 there’s really no point in storing anything in a dB I can always just change the cypher

PyCoder01 (80)

@DartZII bro if there is important information that is "encrypted" you can view it in decrypted.txt and encrypted.txt. This program is bad if the encrypted and decrypted are stored in txt files.

Dart (1143)

@PyCoder01 nothing’s stopping you from removing it

PyCoder01 (80)

@DartZII Ok. Can I post it when I'm done?

Dart (1143)

@PyCoder01 if it’s just going to be a repost then I’d rather not :/

PyCoder01 (80)

@DartZII im almost done. I just need a way to hide the source code.

Dart (1143)

@PyCoder01 it’s ok dude, I’m fully capable of implementing SQLite or mongodb if I want to

PyCoder01 (80)

@DartZII I found a way to run it and keep the code hidden

PyCoder01 (80)

@DartZII Dang it! ReplDB won't work. I need a different DB.

PyCoder01 (80)

@DartZII I could use .env but I could only use it.

Dart (1143)

@PyCoder01 there aren’t too many options unless you run it from a flask server and at that point you might as well just use b64 or manually change the cypher so only you have the solution

PyCoder01 (80)

@DartZII what's base 64? I've heard about it.

PyCoder01 (80)

@DartZII so basicly I just need a way to hide the encrypted strings

PyCoder01 (80)

@DartZII I need a way to hide the code and to hide the encrypted strings!!!!

Dart (1143)

@PyCoder01 encryption type, it’s pretty cool, and easy to do in python

PyCoder01 (80)

@DartZII bro i need a database to store the code in. Then I can do a basic thing. exec(VariableForCodeFromDB)

PyCoder01 (80)

@DartZII make a database that stores the code then pass me the key then delete the key once I say I have the key.

PyCoder01 (80)

@DartZII nvm. I'll make one myself

JBloves27 (1521)

... Really cool, but some suggestions:

  • Add a while loop
  • Maybe try using db instead of files?

... I hope these help ;)

Dart (1143)

@JBYT27 the while loop idea is what i normally do but i didnt really think i needed it

MarcusWeinberger (678)

Technically that's not encryption and I'm unsure if it can be called a cypher. Check this out, https://repl.it/@MarcusWeinberger/hackerman-crypt

Dart (1143)

@MarcusWeinberger I had a feeling I was wrong lol, thanks for the info

zplusfour (879)

when I insert an uppercase string, it returns nothing.

but with lowercase:

GEISTCODER (21)

Amazing. You got some true skill there

vve (33)

Great way to say some spare words. 👍🏾

DynamicSquid (4567)

I think you need some for loops and arrays :)

realTronsi (907)

misleading title :/