Class JetPasswordHandler


  • public class JetPasswordHandler
    extends Object
    Adds, changes and removes the database password on a jet 4 database.

    Two pieces of state have to agree. The password field in page 0 is what makes ms access prompt for a password, and every SID stored in the database is masked with an rc4 keystream whose key is folded out of page 0, the password field included. Writing only the password field produces a database which ms access prompts for and then refuses to open, reporting that the user does not have permission.

    So changing the password means re-masking every SID under the new key. The plaintext SIDs never have to be known: xor-ing out the old keystream and in the new one converts a stored value directly, which also means this works for a database created under any workgroup file.

    Author:
    James Ahlborn
    • Constructor Detail

      • JetPasswordHandler

        public JetPasswordHandler​(Database db)
    • Method Detail

      • setPassword

        public void setPassword​(String password)
                         throws IOException
        Sets the database password, or removes it if the given password is null or empty.
        Throws:
        IOException