Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! Clones, Extensions, Modding » Stars! Extensions » Stars! decryption
Re: Stars! decryption Tue, 31 July 2018 00:49 Go to previous messageGo to previous message
ricks03 is currently offline ricks03

 
Officer Cadet 1st Year
Creator of TotalHost and Stars! utilities
Created TotalHost and Stars! utilities

Messages: 222
Registered: January 2012
Location: NC
OK. So the password is stored in the .m file, in the player block (Block #6), in bytes 12-15. Perhaps everyone else knows this (the player block(s) also exist in the .hst file)

Here's my understanding. Stars file data is stored in blocks. Each block consists of the block type and block size, followed by data that's encrypted (which really isn't "encrypted") using a random seed (which isn't really "random").

If I use the Decryptor class from the stars-4x Github repository: https://github.com/stars-4x/starsapi I can determine the random numbers and decrypt the Player block in the .m file.

I created a game with 2 players, and then I made a copy of it. In one copy, I just saved and submitted, and generated turn 2401. In the other copy, I set the player password in 2400, and generated turn 2401. Bytes 12-15 are all 0s in a non-passworded .m file, and not all 0s in a passworded file. Everything else is the same. I don't know what the password is, but I figure I can just change those values to 0, and reencrypt and write it back out, permitting replacing the password with null (That will take me a while, working from a language I don't know, dealing with binary data which I don't understand, but I'll get there).

What I think is interesting / questionable in my theory is that when I look at the two almost identical .m files from 2401, I would expect only the player block part of the data to be different, but the entire file is different after the FileHeaderBlock (block 8, the first block) and the Block ID and size for Block 6 (the second block).

Or is another level of encryption added on the .m file when a password is set?

If that's the case, it clearly doesn't apply to the .HST file (since the host obviously doesn't need everyone's password). So that password data is likely accessible/changeable in the .HST file, just pull it apart, write the .HST file back out, and generate new turns to generate new, clean, password-less .m files?

Insights appreciated.
Rick





https://www.irelandbybicycle.com
http://totalhost.sinister.net:999
https://github.com/ricks03/TotalHost

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Stars!tools: merging and fuel usage
Next Topic: Stars! API
Goto Forum:
  


Current Time: Fri May 03 02:49:35 EDT 2024