Ren'Py Locked gallery with password

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,969
16,222
With so few information...

Python:
screen navigation():
    [...]
        textbutton _("About") action ShowMenu("about")

        textbutton _("Gallery") action Call( "showGallery" )
    [...]


label showGallery:
    if renpy.input( "password" ) != "blabla":
        "Wrong password"
        return
    call screen gallery

screen gallery():
   [whatever you want]
 
  • Heart
Reactions: galena1

galena1

New Member
Jan 26, 2023
11
3
With so few information...

Python:
screen navigation():
    [...]
        textbutton _("About") action ShowMenu("about")

        textbutton _("Gallery") action Call( "showGallery" )
    [...]


label showGallery:
    if renpy.input( "password" ) != "blabla":
        "Wrong password"
        return
    call screen gallery

screen gallery():
   [whatever you want]
Thanks for the help :)
 

osanaiko

Engaged Member
Modder
Jul 4, 2017
2,548
4,635
You should be aware that it is trivially easy to decompile Renpy game files/asset archives. So you won't be protecting anything for more than a few minutes if someone who is interested and has a little bit of techincal skill wants to get the password.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,969
16,222
You should be aware that it is trivially easy to decompile Renpy game files/asset archives. So you won't be protecting anything for more than a few minutes if someone who is interested and has a little bit of techincal skill wants to get the password.
Should have added that to my post :(
 
  • Like
Reactions: osanaiko

n00bi

Member
Nov 24, 2022
427
527
You can not hide the password with/in python.
As osanaiko said. it can be found in minutes.
Once disassembled you can just check the images/videos directly. no need for the game anymore.

There is also no point in hashing, encrypting etc the password ether, using python.
It can easily be bypassed by replacing modified file(s).

Not all hopes are fully lost tho.
In the end. it kind of depends how dedicated you are to hide your gallery from users.

You can make it harder.
One way is to create a C lib (dll extension). embed the password as encrypted ofc.
This requires that you have knowledge about current version of python your renpy is using, and so forth.

one easy way to hide the gallery is to have the password embeded in a dll file. encrypted ofc.
the decryption function must also be in this dll file, else its kind of pointless.

But problem is not fully over.
This can easily be bypassed as well. just by check where it calls the functions you have in your C file and exclude them from the py file.
write your own mod so to speak.
So what to do then?
You can for example mess up the headers of the image/video files by adding extra bytes, or removing know header parts.
and have the code to read the files in the dll file.
So if someone disassembles the game and get the files when they try to open the video file in lets sayt VLC. it will go apeshit cos it will see the file as corrupt.
There are a ton of other ways to do this aswell.

but as i said. it kind of depends how dedicated you are to hide your password from others.
its not impossible, but imo its not worth the effort.
better to spend that time on actual game dev. story stuff, rendering etc.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,969
16,222
but as i said. it kind of depends how dedicated you are to hide your password from others.
No, it depend what he intend to do with this password.

For many devs it's more an incentive than an effective barrier. The goal not being to keep people outside of the content, but to make them want to jump on the other side of the fence, by pledging.
And globally it works. Even if, in the end, the benefit is relative because the password end in plain light here, it show that the creator care about his patrons.
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,608
2,256
It can easily be bypassed by replacing modified file(s).

You're right... but...

Most of the people who hang around this forum will know they can just go into the script and tweak things to completely bypass the password. Significantly confident people could even write a mod that the average user can install to bypass it too.

But I'd say the majority of players don't know how to unpack an .rpa archive or even know they could look at and edit an .rpy file.
Those that can would likely be technically competent enough to bypass a password. But those that just "play" the game are going to be stopped by it.
Or... maybe I'm underestimating the "average" player.
 
  • Like
Reactions: anne O'nymous

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,969
16,222
Or... maybe I'm underestimating the "average" player.
Seen the number of people who use SaveEdit for Ren'Py games, while the console would be way faster, it's more that you're overestimating "most of the people who hang around this forum".

I would also add that among those who know how extract file from a RPA archive, eventually get back the RPY files, and that they can edit the said files, many would have a hard time figuring something else that the global story. It's one thing to be able to search for a string in order to see what menu choice is the best one, and a totally different one to find where the game ask for a password and what is the said password.
 
  • Like
Reactions: 79flavors

n00bi

Member
Nov 24, 2022
427
527
anne O'nymous well. if the intent is to show that the creator care about his patrons.
Then the average players isn't the problem.
Its the 1 user who shares the password and post it on forums like this.

I was just sharing some ideas about how to make it harder to find/crack.
but then again. some jackass that got the password by completing the game or however the password is given out,
he could just share it on a forum anyway.

To be relative safe against this you basically need to have a key for each instance of the game.
Implement something like a "cd-key" function for the gallery. and that aint a good idea using python.
So as i said. it kind of depends how dedicated you are to hide your gallery from users.
It is not impossible, just requires a lot more work.