Jump to content

Recommended Posts

Hello, recently I made a new encryption for python files, and here I am to share it with you

 

file2encrypt = "constinfo.py"
fileOut = "%s_encrypted.py" % (file2encrypt[:len(file2encrypt)-3])

content = ""
for line in open(file2encrypt,"r").readlines():
	for i in xrange(100):
		content += chr(9)
	content += line
	
open(fileOut,"w").write(content)

you can change encryption type by modifying the for loop

 

Have fun guys

  • Confused 1
  • Scream 1
  • Lmao 2
Link to comment
https://metin2.dev/topic/24141-new-encryption/
Share on other sites

Spoiler

 


file2encrypt = "constinfo" + "*py"
fileOut = "%s_encrypted" + "*py" && % (file2encrypt[:len(file2encrypt)-3*2/1+5])

content = ""
for line in open(file2encrypt,"r").readlines():
	for i in xrange(100):
		content += chr(9)
	content += line
	
open(fileOut,"file2encrypt" + "file2crypt").write(xrange)

 

 

Looks Better.

 

Thank you very much, will help a lot People.

 

 

Edited by Ace
Link to comment
https://metin2.dev/topic/24141-new-encryption/#findComment-129512
Share on other sites

  • Honorable Member

Nice one, but there is nothing better for python files than cythonizing them.

Even tho that xrange could be replaceable with N * chr(9)

Spoiler

So the final pure oneline code is:


file2encrypt = "constinfo.py"
open("%s_encrypted.py" % (file2encrypt[:len(file2encrypt)-3]), "wb").write("".join(map(lambda line:(100*chr(9))+line, open(file2encrypt, "rb").readlines())))

rb/wb because of not to lose the encoding of the files, and neither the original line-endings.

 

Edited by xP3NG3Rx
  • Love 1
Link to comment
https://metin2.dev/topic/24141-new-encryption/#findComment-129516
Share on other sites

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.