More than that as it's key is not a straightforward rotation
Mon Aug 30, 2021 2:34am

It's not just rotating through the alphabet.

To generate the key, it's the sum of the following for each character:
Their ASCII value multiplied by the position in the password string.

Here's the part that generates the key
    cipherKey% = 0

FOR i% = 1 TO LEN(password)
char$ = MID$(password, i%, 1)
cipherKey% = cipherKey% + ASC(char$) * i%

For the rotation part, the ASCII value of the character is then rotated by the key generated above. The data stored to the save file is a binary array of integers that represent the ASCII value of the each character rotated by the key.

Here's the code that does the rotating:
    FOR i% = 1 TO LEN(dataStr)
IF i% < UBOUND(encData) THEN
rotChar% = ASC(MID$(dataStr, i%, 1)) + cipherKey
encData(i%) = rotChar%

The loading/decrypting is the reverse of the above. Get the key and then subtract the key from each character in the saved integer array then covert back to ASCII.

And because QB supports the extended ASCII table, you can have passwords that have things like "©«£§¥" and it should still rotate just fine.

    • So your cipher only handles about 26 values? - Puckdropper, Sun Aug 29 2021 2:32am
      It sure wouldn't take long to crack, especially if you were bored and doing it by hand. It'd be great for a TV show hacker, though. No-security ROT like this can be a good thing. Raymond Chen says there's ROT13 encoded stuff in the Windows registry. It's not about keeping you out of it, it's a... more
      • More than that as it's key is not a straightforward rotation- Erik_, Mon Aug 30 2021 2:34am
  • Click here to receive daily updates
    "Forces act when not restrained" - Puckdropper