Garry's Mod

Garry's Mod

30 个评价
Momo's Encryption Library
   
奖励
收藏
已收藏
取消收藏
素材类型: 插件
插件类型: 工具
文件大小
发表于
更新日期
22.074 KB
2017 年 6 月 3 日 下午 7:35
2020 年 2 月 25 日 上午 10:35
4 项改动说明 ( 查看 )

订阅以下载
Momo's Encryption Library

在 Cédric GÉRILLE [GiletJaune] 的 4 个合集中
Board Games by Mohamed Rachid
16 件物品
Soccer by Mohamed RACHID
37 件物品
Université Joseph Poireau (serveur)
70 件物品
G-1:788429
50 件物品
描述
Library to encrypt Lua files or any kind of data

Information
The Wiki of this library[github.com]
Big update: compression is available!
The crash after a few hours is now fixed.

Notes
- Relative Lua paths are not allowed.
- Key: for clientside Lua includes, avoid crazy long keys.
- Using compression is important with the default "msubstract" method while encrypting Lua files and other text-based contents to ensure a reasonable encryption strength.
- This tool allows to encrypt Lua files, but it does not prevent Lua code capture tools from catching decrypted code. So code obfuscation is not useless.

Encryption methods
- "substract" (substract the value of each key byte from the input data) - "msubstract" (same as "substract", but key bytes are multiplied before use)
Other encryption methods will be added later if possible.
free
Functions
momo_encryption.CreateKey( bits )
Generate a key of the given length.
return: (string) random hex string bits: (int) key length in bits
momo_encryption.Encrypt( key, content, compress, method )
Encrypts content with key.
return: (string) encrypted data key: (string) hex string content: (string) clear data compress: (bool) compress data using LZMA (recommended) method: (string) encryption method
momo_encryption.Decrypt( key, encrypted, paranoid, decompress, method )
Decrypts encrypted with key.
return: (string) decrypted data key: (string) hex string encrypted: (string) encrypted data paranoid: (bool) avoid using table.concat() decompress: (bool) decompress data using LZMA method: (string) decryption method
momo_encryption.EncryptFile( key, fileName, path, destination, compress, method )
Encrypts fileName as a binary file to destination with key.
return: (string) if destination == nil, the encrypted data key: (string) hex string fileName: (string) path to the clear file path: (string) File Search Path for fileName, see http://wiki.garrysmod.com/page/File_Search_Paths destination: (string) path to the destination file (relative to data folder) compress: (bool) compress data using LZMA (recommended) method: (string) encryption method
momo_encryption.DecryptFile( key, fileName, path, decompress, method )
Decrypts fileName as a binary file with key.
return: (string) decrypted data, false on failure key: (string) hex string fileName: (string) path to the encrypted file path: (string) File Search Path for fileName, see http://wiki.garrysmod.com/page/File_Search_Paths decompress: (bool) decompress data using LZMA method: (string) decryption method
momo_encryption.EncryptLuaFile( key, fileName, path, destination, compress, method )
Encrypts fileName as a Lua file to destination with key.
return: (no value) key: (string) hex string fileName: (string) path to the clear file path: (string) File Search Path for fileName, see http://wiki.garrysmod.com/page/File_Search_Paths destination: (string) path to the destination file (relative to data folder) compress: (bool) compress data using LZMA (recommended) method: (string) encryption method
momo_encryption.DecryptLua( key, encrypted, identifier, runNow, decompress, method )
Decrypts encrypted as Lua code with key.
return: (function) decrypted Lua code return: (vararg) if runNow, values returned by the Lua code key: (string) hex string encrypted: (string) encrypted Lua code identifier: (string) path to show in error messages (does not have to be unique) runNow: (string) run the Lua code now? decompress: (bool) decompress data using LZMA method: (string) decryption method
momo_encryption.DecryptLuaFile( key, fileName, identifier, runNow )
Decrypts fileName as a Lua file with key.
return: (function) decrypted Lua file return: (vararg) if runNow, values returned by the Lua file key: (string) hex string fileName: (string) full path to the encrypted Lua file (relative to lua folder) identifier: (string) path to show in error messages (does not have to be unique) runNow: (string) run the Lua file now?
momo_encryption.IncludeLuaFile( key, fileName, identifier, includeOnServer, includeOnClient )
Includes an encrypted Lua file on the server or on the client.
return: (vararg) if includeOnServer, values returned by the Lua file key: (string) hex string fileName: (string) full path to the encrypted Lua file (relative to lua folder) identifier: (string) path to show in error messages (does not have to be unique) includeOnServer: (bool) include the file serverside includeOnClient: (bool) include the file clientside
Note: Player:SendLua() is not used because of limited length & Lua code capturing danger.
free
热门讨论 查看全部(1)
0
2018 年 7 月 7 日 上午 6:54
Ideas for RSA (or other asymmetric) encryption
Cédric GÉRILLE [GiletJaune]
15 条留言
Cédric GÉRILLE [GiletJaune]  [作者] 2021 年 11 月 28 日 上午 3:08 
It's basically nothing more than an API. Most of implemented things do not have an out-of-the-box purpose. The protection against Lua code stealing is inefficient.
memory 2021 年 11 月 23 日 上午 10:18 
I don't understand, can i have a video how to configure it? thanks
Cédric GÉRILLE [GiletJaune]  [作者] 2020 年 2 月 25 日 上午 11:02 
Hehe yes and I agree with the decision! :-P
This add-on is updated though. :-3
Lord of Owls 2020 年 2 月 25 日 上午 10:53 
yea, rubat recently decided to update to steamugc for addons aswell gmad.exe received an update for to prevent malformed header issues
Cédric GÉRILLE [GiletJaune]  [作者] 2020 年 2 月 25 日 上午 9:50 
It's called "manual rename". I applied an illegal filename in order to have a greater priority in the loading process.
Okay now that you say it, I think that there are new checks in .gma files. :steamsad:
Lord of Owls 2020 年 2 月 25 日 上午 6:41 
your gma file seems to have been corrupted at some point. I'm getting the following in my console when subbed to the addon
```
Not loading addon 'Momo's Encryption Library' - Invalid filename: 'lua/autorun/momo_encryption.lua': Code point 6
Couldn't mount addon file 'addons/momos_encryption_library_939273135.gma' from 'Momo's Encryption Library' (939273135)
Removing bad addon addons/momos_encryption_library_939273135.gma
```
Cédric GÉRILLE [GiletJaune]  [作者] 2017 年 9 月 16 日 下午 6:18 
Non désolé.
󠀡 2017 年 9 月 16 日 下午 6:16 
ducoup scripthook est patchable ?
Nogitsu 2017 年 6 月 22 日 上午 9:14 
Then you will have an up to date encryption system :steamhappy:
Cédric GÉRILLE [GiletJaune]  [作者] 2017 年 6 月 7 日 下午 5:27 
Bad idea, but the rules of Workshop allow you to download and use.
A better protection for all users is ensured if the addon is kept as a GMA addon.