Any plans on RenPy Asset Encryption

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Posts: 6
Joined: Fri Mar 09, 2018 12:58 am

Any plans on RenPy Asset Encryption

#1 Post by renpycoder » Sat Aug 18, 2018 10:12 am

First of all I would like to say that I love RenPy so much so I am here to ask this. Inasmuch as I love RenPy, there's something I'd like it to have. Encryption. For a game that you want to release commercially, it's really hard if the game files are open just like that. Is there a necessary or possible way of encrypting your assets and still playable by the python reader in RenPy? Or is this something Tom, the developer of this engine is working on for future work?

Thanks in advance, everyone!

User avatar
Lemma-Class Veteran
Posts: 3645
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA

Re: Any plans on RenPy Asset Encryption

#2 Post by trooper6 » Sat Aug 18, 2018 1:22 pm

Are you aware of the Archive option when making your build?
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: ... 51&t=21978

Posts: 199
Joined: Sun May 29, 2016 4:38 pm

Re: Any plans on RenPy Asset Encryption

#3 Post by rames44 » Sat Aug 18, 2018 7:06 pm

Archives aren’t encrypted - it’s trivially easy to extract the contents of the archive.

It’d be awfully hard to really protect the assets in a game given the way Python works. Sure, you could code some encryption so that “raw archive extracts” weren’t directly usable, but it wouldn’t necessarily take much of a programmer to defeat it - given that your game has to be able to decrypt the assets as the game is played, any competent hacker is going to be able to extract this code and then create a tool to run it outside of the game context to decrypt the assets. I’ve seen this done over and over on Unity games that tried to protect their assets with custom C# encryption. As long as you can work backwards from the distributed game to source code (which is pretty trivial with Ren’py as well as with Python itself), this is a losing battle, IMHO. PyTom probably has far better things to work on.

Note that if you did want to take a shot at this yourself, the logical place of attack would be at the point where Ren’py extracts assets from the archive files. The code is available on Github - have at it yourself, or find a Python programmer willing to do so.

User avatar
Posts: 284
Joined: Sun Nov 06, 2016 5:34 pm

Re: Any plans on RenPy Asset Encryption

#4 Post by ISAWHIM » Sun Aug 19, 2018 7:11 am

The only form of "protection", directly, is the archive option. Like it was stated, it is not intended for "protection", as it is easily unzipped/unarchived.

Tom has already expressed that there is no interest in adopting any of the false-securities into RenPy. Most are just a hindrance, more than anything. Causing more problems than they attempt to solve.

For protections, you are best to implement some kind of third-party protection, or have some kind of "live login", which depends on a server for some critical components. (They would have to emulate the server, with the critical components, in order for it to be replicated as functional.)

There is only one current protection for software that exists, which is a stand-alone solution. (Requires an online connection, but has drop-in game ability.) That is the "Denuvo Software Solutions", form of protection. It runs in a virtual-environment, isolated from the OS, and uses an inline encryption/decryption method, to complicate things for pirates. (Most games take longer than a week to crack, but all get cracked.)

However, even they are not "crack-proof". Nothing is, to date. It is a catch-22... In order for people to play it and see it, it has to be decrypted at some point. If it can't be decrypted, most things can just be reconstructed in the unencrypted form, from what is sitting in memory and displayed and being used, in code.

The harder you make it to use, the less you will find that it is used. The archives are a simple solution that is effective enough to stop casual users from folder-poking for your data. The others, if they want it bad enough, can and will get it, if it is worth getting. Focus on making material worth getting, instead of attempting to control the uncontrollable and limiting who can gain from your creations.

The only certified form of protection would be to build your own computer-system that is a one-way gate to display your creations, without any way to access the data otherwise. Even those can eventually be hacked to reveal the contents, but it takes the longest amount of time and greatest amount of resources to do. (Few things are worth the process of dissection, by those methods.)

User avatar
Lemma-Class Veteran
Posts: 2813
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor

Re: Any plans on RenPy Asset Encryption

#5 Post by Imperf3kt » Mon Aug 20, 2018 8:19 pm

You can add an extra layer of security with this useful information
you can generally without an extension, renpy reads and recognizes any image format from the file itself.

image any one can write down, simply changing the value here

imagebutton idle ("k" + str (globals () ["cl" + str (z)] ) + ". w")


imagebutton idle ("k" + str (globals () ["cl" + str (z)] ) + ". png")
Just as easily undone as an archive, but will help deterr some.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.


User avatar
Eileen-Class Veteran
Posts: 1849
Joined: Sat Jan 19, 2008 2:47 pm
Projects: The Space Between

Re: Any plans on RenPy Asset Encryption

#6 Post by LateWhiteRabbit » Mon Aug 20, 2018 10:37 pm

ISAWHIM wrote:
Sun Aug 19, 2018 7:11 am
However, even they are not "crack-proof". Nothing is, to date.
Focus on making material worth getting, instead of attempting to control the uncontrollable and limiting who can gain from your creations.
This. Not even billion-dollar game studios can keep people from cracking their games and accessing assets, etc. So why bother?

Who cares if someone 'steals' your assets? They can't be used legally by someone else. It will most likely be fans doing so anyway. Like ISAWHIM said, just focus on making your game so awesome people WANT to break into your archive files. People only do that with successful games anyway.

Post Reply

Who is online

Users browsing this forum: Alex, Bing [Bot], Google [Bot]