Stormworks: Build and Rescue

Stormworks: Build and Rescue

Not enough ratings
Ponys Microcontroller Tools - Encryption and Decryption Example
   
Award
Favorite
Favorited
Unfavorite
Tags: v0.10.29
File Size
Posted
104.387 KB
10 Jul, 2020 @ 8:22am
1 Change Note ( view )

Subscribe to download
Ponys Microcontroller Tools - Encryption and Decryption Example

Description
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 Comments
[20.]Goblox432 15 Apr, 2024 @ 4:57am 
IT is using the in Off signall to Figur Out a number and that number plus a multipication If 30 ist the key
CrazyFluffyPony  [author] 15 Apr, 2024 @ 4:24am 
Ah okay. then it's not a flaw in the algorithm.

Still, well done implementing a brute force system for it.
[20.]Goblox432 15 Apr, 2024 @ 2:21am 
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  [author] 14 Apr, 2024 @ 12:37pm 
Awesome. Post me the link so i can add it to the description.
Do you have a fix for it too?
[20.]Goblox432 9 Apr, 2024 @ 9:34am 
I managed to build a microcontroller to break the encryption