News for hackers. Stuff that matters.
Re:SQLite as an Application File Format (2014) by bstar77 on Saturday June 13, 2020 @11:39AM (#23510189)
Is anyone doing this in Javascript (via electron) and encrypting the file in such a way that the data is protected and not an obvious sqlite db?

I have some ideas on how to do this, but I'm curious if there's a "preferred" way to do it.

Re:SQLite as an Application File Format (2014) by pilif on Saturday June 13, 2020 @11:51AM (#23510268)
SQLite has encryption plugin support, or you could encrypt the file yourself at rest. However, no matter what you are doing, as the application needs to be able to decrypt the file, you have to ship the key and thus the protection will be able to be circumvented.

It’s really not worth the effort IMHO

Re:SQLite as an Application File Format (2014) by bstar77 on Saturday June 13, 2020 @11:55AM (#23510305)
That's a good point... I don't want to have the game rely on "phoning home" to decrypt the db.
Re:SQLite as an Application File Format (2014) by yellowapple on Saturday June 13, 2020 @08:00PM (#23513934)
On top of that, even if you did have the game "phone home", that doesn't do much against someone inspecting the memory of a running game; one could just wait until the game does have the decryption key.
Re:SQLite as an Application File Format (2014) by gregmac on Saturday June 13, 2020 @11:48AM (#23510256)
Why would you want to "protect" the data in this way? It's user-hostile, and anyone determined enough will be able to get at it no matter what you do.

If it's popular and valuable enough, instructions and/or code to break it automatically will then be published, regardless of how much money or time you invested into the protection. (For proof, look no further than the game industry's DRM over the past 30 or so years)

Re:SQLite as an Application File Format (2014) by bstar77 on Saturday June 13, 2020 @11:54AM (#23510293)
It's not meant to be user hostile, it's for a game. I allow data exports, but I don't want to expose the inner workings of the game via direct access to the DB.
Re:SQLite as an Application File Format (2014) by lxdesk on Saturday June 13, 2020 @02:48PM (#23511669)
Data mining is an old gamedev worry. Nobody who's been doing it for a while particularly cares. If the game is remotely popular, data mining will happen. Disassembly to find the decrypt function is a talent possessed by many, many people who have the reverse-engineering bug. If you then obfuscate the code, you have made things interesting and then increasingly talented people will try to have a go at it. If you combine a changing obfuscating technique with updates, you can slow down community possession of the game with respect to modding etc., and Minecraft worked that way in its beta phases. But it's really all a question of your purpose at that point.

If you haven't already, I suggest cruising through TCRF: https://tcrf.net/The_Cutting_Room_Floor

Re:SQLite as an Application File Format (2014) by Vendan on Saturday June 13, 2020 @12:38PM (#23510657)
You do realize, exposing the "inner workings of the game" seems to be at least somewhat responsible for massively increasing the appeal of the game in other cases? see Minecraft, Rimworld, KSP as a few examples...
Re:SQLite as an Application File Format (2014) by serf on Saturday June 13, 2020 @04:03PM (#23512249)
... see Minecraft, Rimworld, KSP as a few examples...

I mean, I agree that games should be moddable, but not from the premise of game profitability and popularity.

The highest-grossing video game franchise list is over-ran by products that are , pretty much, famously unmoddable.[0]

[0]: https://en.wikipedia.org/wiki/List_of_highest-grossing_video...

Re:SQLite as an Application File Format (2014) by TeMPOraL on Saturday June 13, 2020 @04:41PM (#23512519)
That list has some old and long-running franchises (e.g. Mario), some semi-interactive movie experiences (e.g. CoD), and some games that have in fact been modded to ridiculous extent (Warcraft, StarCraft, The Sims). I wouldn't read too much from it.
Re:SQLite as an Application File Format (2014) by Vendan on Saturday June 13, 2020 @07:15PM (#23513668)
The unmoddable ones are mostly there cause they are big names or old names. I mean, heck, LoL was literally inspired by how moddable Warcraft 3 was. If you aren't using a massively well known source material, and you don't have a AAA game studio, your main chance to make a big game according to that list seems like either moddability or cheesy facebook game tactics.