[Lib] LOVEE [Love Encryption] Encrypt lua files & Images
Posted: Sun Dec 21, 2014 6:41 am
So the other day i lost one of my love2d projects, but had only a .exe packed version of it. A few modifications and coding later i was able to make a tool that could extract the .love/.zip resource from the .exe and found out that i could extract the resources from any love2d .exe so i didn't feel safe and decided to code an encryption library. I won't be releasing that tool since i don't think developers would like that including myself lol.
If you use this library i suggest that you make a backup of your files since i only coded the encryption for one way there is no decrypt option. There are 3 total options for the encryption library, Obfuscator, Obfuscator + Encryption, and Encryption. with this library you can also load an encrypted image using the IMGEncrypt tool.
Some pointers if you Obfuscate your code you must change the data = {} array name and in the loadFile(MyDataArrayName, key) to load it.
For encrypted images love.graphics.newImage(imgData) always stays the same, but you can assign the image variable name and call the draw later on.
The IMGEncrypt tool should only be used for small-medium images nothing crazy like a background/wallpaper image it might work, but will either cause the application to hang or take a long time to encrypt.
Functions to load the encrypted files:
Basic Set-up
LOVEE Lib:
https://www.mediafire.com/?l8h2vgm665ftmya
IMGEncrypt tool:
http://www.mediafire.com/download/262p5 ... ncrypt.exe
LOVEE Encryption site:
http://elovee.tk
Encrypted Example w/ Original unencrypted lua file: (Just use the keys w, a, s, d to move the image)
https://www.mediafire.com/?kp1qo21ly0azuo8
If you use this library i suggest that you make a backup of your files since i only coded the encryption for one way there is no decrypt option. There are 3 total options for the encryption library, Obfuscator, Obfuscator + Encryption, and Encryption. with this library you can also load an encrypted image using the IMGEncrypt tool.
Some pointers if you Obfuscate your code you must change the data = {} array name and in the loadFile(MyDataArrayName, key) to load it.
For encrypted images love.graphics.newImage(imgData) always stays the same, but you can assign the image variable name and call the draw later on.
The IMGEncrypt tool should only be used for small-medium images nothing crazy like a background/wallpaper image it might work, but will either cause the application to hang or take a long time to encrypt.
Functions to load the encrypted files:
Code: Select all
Obfuscated code load:
love.filesystem.load("myEncryptedFile.lua")()
loadFile(dataArrayName, key)
Encrypted code load:
d=getData("myfile.lua", key)
loadData(d)
Obfuscated image load:
love.filesystem.load("encrypted_image.png")()
loadIMG(imgArrayName)
image = love.graphics.newImage(imgData)
Basic Set-up
Code: Select all
require("LOVEE")
init() --Initiate the encryption lib
function love.load()
love.filesystem.load("MYencryptedIMAGE.png")()
loadIMG(MyImage)
image = love.graphics.newImage(imgData)
end
function love.update(dt)
end
function love.draw()
love.graphics.draw(image, 0, 0)
end
https://www.mediafire.com/?l8h2vgm665ftmya
IMGEncrypt tool:
http://www.mediafire.com/download/262p5 ... ncrypt.exe
LOVEE Encryption site:
http://elovee.tk
Encrypted Example w/ Original unencrypted lua file: (Just use the keys w, a, s, d to move the image)
https://www.mediafire.com/?kp1qo21ly0azuo8