Log In  

So I was thinking about how charming it would be to make a password system for my current game in progress, but I'm not entirely sure where to start on it.

I guess the first thing I would need to do is determine which values need to be saved to the password, determine the ranges in which these values are valid, determine the base for each character in the password, and then encrypt the password which displays to the player when they want to quit the game.

Let me make a small hypothetical data set that needs to be saved in the password:

HP-LV  (min 0, max 6, 3 bits)
MP-LV  (min 0, max 6, 3 bits)
SCORE  (min 0, max 99999999, saves in multiples of 100, so real range is 0-999999, which means 20 bits)
STAGE  (min 0, max 7, 3 bits - stage saves as 0-7)
INV.   (bitfield of 10 items, 15 bits (5 items have level-2 upgrades, one bit each))

TOTAL: 44 bits (move this up to 48 to increase non-possible pw combos)
HHH MMM SSSSSSSSSSSSSSSSSSSS TTT IIIIIIIIIIIIIII 0000

Possible PW Character Set (base 32):
ABCDE FGHIJ KLMNO PQRST UVWXY Z1234 56

48 bits / 6 bits per character = password length of 8.

Possible password attempt:
QQQQQQQQ (Solar Jetman fans, word up!)
Q=16

per character:
010000 010000 010000 010000 010000 010000 010000 010000

per assignment
HHH MMM SSSSSSSSSSSSSSSSSSSS TTT I2I2I2I2I2IIIII 0000
010 000 01000001000001000001 000 001000001000001 0000

This equates to:
HP-MAX Lv.2
MP-MAX Lv.0
SCORE: 266305+00
STAGE: 0
INV.:  2 items obtained (level 0), 1 passive item
ERR BITS: 0 (pass)

So, I need to figure out how to encrypt this password to be harder to interpret, as well as utilize the error bits at the end to further keep players from typing in random passwords and getting "cheat passwords". Any ideas on how I can go about this?

P#81281 2020-08-28 05:07

These are the methods I can come up with.

  • The sum of all the bits is used as the error code.
  • The parameter start position is arbitrarily rotated (a bit for rotation is added).
  • Offset the word (add bits for offset).

(I once parsed the password for Wizardry Gaiden 3's reincarnation when I was still in school, but I lost that note ,'< )

P#81287 2020-08-28 07:04

@shiftalow

For the first bullet point, how could I use this checksum to verify if this is a valid password or not?

The rotation aspect makes sense. I could utilize that.

By offsetting the word, do you mean to shift letters? For example, a password AAAAAAAA would be shifted some arbitrary amount of characters to something like CCCCCCCC or something?

P#81288 2020-08-28 07:36

>Checksum

In the above specification, the error code is 4 bits, so you can check it with a value of 0-15. Assuming you use it.

For example
Total of all bits of correct PASS: 25
 Checksum value: 9 = 25%16(4bit)

Total of all bits entered: 40
 Checksum value: 8 = 40%16(4bit)
*This is wrong!

>by offsetting the word

Yeah, I mean that in a way that shifts the letters from A -> C.(6 rotate to A)

It is difficult to prevent "cheat passwords" completely, but it is fun and fascinating to find them by accident.

P#81289 2020-08-28 08:34 ( Edited 2020-08-31 23:45)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-04-19 21:49:31 | 0.016s | Q:13