From d02a8a89b49e489bdbb5b4f7d8ce82011ceb4988 Mon Sep 17 00:00:00 2001 From: trivernis Date: Fri, 13 Mar 2020 14:30:07 +0100 Subject: [PATCH] Update Readme --- Cargo.toml | 2 ++ README.md | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 72 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 34b52b5..edfc2a8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,6 +3,8 @@ name = "bdflib" version = "0.1.0" authors = ["trivernis "] edition = "2018" +license-file = "LICENSE" +license = "GPL-3" [lib] name = "bdf" diff --git a/README.md b/README.md index a12e117..1fb776e 100644 --- a/README.md +++ b/README.md @@ -1 +1,70 @@ -bdflib +# bdflib + +This library provides methods to read and write Binary Dictionary Format files that can be used to represent rainbow tables. + +## Binary Dictionary File Format (bdf) + +``` + =
[] +``` + +All `u8` format are unsigned BigEndian numbers. + +### Header + +Raw (hex) `42 44 46 01 52 41 49 4e 42 4f 57` + +| Position | Name | Value | Meaning | +| -------- | ----------- | --------- | ---------------------------------- | +| 0-2 | Format | `BDF` | Indicates the bdf Format | +| 3-4 | Version | u32 | The revision of the format (0x01) | +| 4-10 | to be fancy | `RAINBOW` | The word "Rainbow" because why not | + + +### Chunk + +| Position | Name | Value | Meaning | +| ------------- | ---------- | ----- | ------------------------------ | +| 0-3 | length (l) | u32 | the length of the data chunk | +| 4-7 | name | ASCII | the name of the chunk | +| 8-l | data | any | the data of the chunk | +| l + 1 - l + 5 | crc | crc | the crc sum value of the chunk | + +### Meta Chunk + +The format of the data inside the `META` chunk. +The data is mandatory for the file to be interpreted and the chunk should be the first chunk in the file. + +| Position | Name | Value | Meaning | +| -------- | ----------------------- | ---------------- | ---------------------------------------------------------------- | +| 0-3 | chunk count | u32 | The number of `DTBL` chunks in the file | +| 4-7 | entries per chunk | u32 | The maximum number of Data Rows in each chunk | +| 8-15 | total number of entries | u64 | The total number Data Rows in the file | +| 16-19 | compression method | ASCII/0x00000000 | The name of the compression method or null bytes if none is used | + +### Data Row + +The format inside the `DTBL` chunk. +A chunk contains multiple data rows. + +| Position | Name | Value | Meaning | +| --------- | ---------- | ----- | --------------------------------------------------------------------------------------- | +| 0-3 | length(lt) | u32 | the total length of the data row | +| 4-7 | length (l) | u32 | the length of the password string | +| 8-l | password | UTF-8 | The password string | +| 1: l+1 - l+5 | type | u32 | the id of the hash function | +| l+6 - l+x | hash | any | the value of the hash function. The length has to be looked up by the hash functions ID | +| goto 1 | + + +### Hash Entry + +The format inside the `HTBL` chunk. +Just like the DataRow the HashEntry is contained in the chunk multiple times. + +| Position | Name | Value | Meaning | +| --------- | ------------- | ----- | --------------------------------------------------- | +| 0-3 | ID | u32 | the id of the entry that is used in the data tables | +| 4-7 | output length | u32 | the length of the output of the hash function | +| 8-11 | length | u32 | the length of the hash functions name | +| 12-length | name | ASCII | the name of the hash function | \ No newline at end of file