Class JetEncodingHandler
- java.lang.Object
-
- com.healthmarketscience.jackcess.crypt.impl.JetEncodingHandler
-
public class JetEncodingHandler extends Object
Adds and removes jet encoding, which is the scheme ms access called "Encode/Decode Database" and removed after access 2003.Every page above page 0 is run through rc4 under the encoding key xored with the page number. Page 0 is never encoded and holds the key in the clear at
JetFormat.OFFSET_ENCODING_KEY, so the scheme keeps nothing secret and stops only a reader which does not know about it. The transform is its own inverse, so one routine does both directions.Only jet 4 is supported. Altering the encoding rewrites the database, and jackcess does not write jet 3, so an encoded jet 3 database can be read through
CryptCodecProviderbut not decoded to a file.Nothing else in the database changes. The SID masking is folded from the creation date and the page 0 password field and never reads the encoding key, so adding or removing the encoding leaves every SID valid, and a jet database password is untouched.
- Author:
- James Ahlborn
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddEncoding(Path srcFile, Path dstFile)Copies the given database to the given destination, adding jet encoding under a freshly generated key.static voidaddEncoding(Path srcFile, Path dstFile, int key)Copies the given database to the given destination, adding jet encoding under the given key, which is for reproducing a known file and must not be zero.static voidremoveEncoding(Path srcFile, Path dstFile)Copies the given database to the given destination, removing its jet encoding.
-
-
-
Method Detail
-
addEncoding
public static void addEncoding(Path srcFile, Path dstFile) throws IOException
Copies the given database to the given destination, adding jet encoding under a freshly generated key.- Throws:
IOException
-
addEncoding
public static void addEncoding(Path srcFile, Path dstFile, int key) throws IOException
Copies the given database to the given destination, adding jet encoding under the given key, which is for reproducing a known file and must not be zero.- Throws:
IOException
-
removeEncoding
public static void removeEncoding(Path srcFile, Path dstFile) throws IOException
Copies the given database to the given destination, removing its jet encoding.- Throws:
IOException
-
-