News:

Biggest free backgammon community - members from over 150 countries. Play backgammon for free on Fibs.com and enjoy the community on fibsboard

Main Menu

Recovering FIBS passwords from Javafibs Preferences

Started by inim, December 19, 2017, 02:56:30 AM

Previous topic - Next topic

inim

From time to time there is a request to recover a forgotten FIBS password from a JavaFIBS 2001 preferences file. Due to some obfuscation (not really encryption) you can not easily recover it. So I decided to document the algorithm in the form of a small Python code snippet. In the hope that this is useful - no warranty, no copyright. Written 2017 by Ingo Macherius and hereby released to the public domain. You find the preferences file needed in the JavaFibs2001 installation directory subfolder "user/yourfibsnick/preferences".

#!/usr/bin/env python

from sys import argv
import struct

if len(argv) != 2:
    print("Usage: " + argv[0] + " file")
    print("'file' is the name of a JavaFibs 2001 preferences file.")
    print("The decrypted password from the file is printed to stdout.")
    exit

filename = argv[1];
print ("Attempting to open Javafibs 2001 preferences file " + filename + " as binary file.")
prefs = open(filename, "rb");

# read in magic file marker (ignored, must be 1.011) and length of password
magic, passwordlength = struct.unpack('>fi', prefs.read(2*4))
print ("File open succeeded.")

# read and decrypt password char by char and build string
password = ""
for i in range (0, passwordlength):
    encrypted = prefs.read(4);
    decrypted = chr(int(struct.unpack('>f', encrypted)[0]))
    password += decrypted

print ("Your FIBS password recovered from it is: '" + password + "'")
This space is available for rent by advertisers. Call 0900-INIMITE today, and see your sales skyrocketing in no time! New customers receive free Vl@9rĂ¥ and a penis enlargement set as a bonus! We support banners, flash banners, and scrollers. Discrete handling by our HQ on the Dutch Antilles.