Stormworks: Build and Rescue

Stormworks: Build and Rescue

评价数不足
Ponys Microcontroller Tools - Encryption and Decryption Example
   
奖励
收藏
已收藏
取消收藏
标签: v0.10.29
文件大小
发表于
104.387 KB
2020 年 7 月 10 日 上午 8:22
1 项改动说明 ( 查看 )

订阅以下载
Ponys Microcontroller Tools - Encryption and Decryption Example

描述
What do i see in the video above?
On the right you see the encrypted composite, on the left you see the decrypted composite

Encrypts and decrypts 30 numbers of a composite
  • Choose any integer as the key (Available range: -16,000,000 to +16,000,000)
  • floats loose a tiny bit of precision (< 1%)

Details about the encryption algorithm
Because of the limited characters and the limited performance of lua ingame, it is impossible to effectively implement currently used algorithms (both symetric and asymetric).
Even worse, in lua we have no access to the raw float bits, which makes number encryption even harder.

Algorithm (simplyfied):
Every tick, a random number m is generated.
The original value (e.g. channel 1 = 3.141) is now modified.
encrypted value = original value + m + (channel id)
  • We ensure that m is a high value, but also has some decimals.
    This is mandatory, because its not helpfull if gps coordinates are encrypted from (x=876,y=123.2) to (x=875.5,y=122.7).
  • Same rule applies for very small values (e.g. battery level) which would be encrypted from (b=0.25) to (b=9000.25).
  • By changing m every tick, we make sure people cannot guess a value by observing its change over time.
  • By adding the channel id we also make sure, that we effectively never use the same modifier m twice. This makes sure, that even if two input values are corelated (e.g. fuel in tank 1 and fuel in tank 2) its very hard to spot that corelation in the encrypted data.
  • The last thing we do is, we shift the channels. This ensures, that even if someone knows on which channel a guessable value would be sent, the encrypted composite does not have this encrypted value on the same channel. This prevents attacks by guessing an original value (e.g. altitude of a vehicle).

Microcontrollers
Encryption
Decryption


Collection of all the tools
https://steamhost.cn/steamcommunity_com/workshop/filedetails/?id=2080346369

See it as a challenge to break the algorithm
I will put your name in here, and if you also can develop a fix i will update the microcontroller ;)
5 条留言
[20.]Goblox432 2024 年 4 月 15 日 上午 4:57 
IT is using the in Off signall to Figur Out a number and that number plus a multipication If 30 ist the key
CrazyFluffyPony  [作者] 2024 年 4 月 15 日 上午 4:24 
Ah okay. then it's not a flaw in the algorithm.

Still, well done implementing a brute force system for it.
[20.]Goblox432 2024 年 4 月 15 日 上午 2:21 
To be fair i used the brute force aproche so the best fix is simply using a high value as your key https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3223124653
CrazyFluffyPony  [作者] 2024 年 4 月 14 日 下午 12:37 
Awesome. Post me the link so i can add it to the description.
Do you have a fix for it too?
[20.]Goblox432 2024 年 4 月 9 日 上午 9:34 
I managed to build a microcontroller to break the encryption