unsigned char crypt unsigned char data int quot aria describedby quot a7h quot style 5151563
unsigned char Crypt(unsigned char data, int” aria-describedby=”a7h”>
Fri 11:2 Tools Window Help 2018 Challenges.pdf (page 3 of 5) Q Search Challenge 2: KDB Files During a forensic investigation, a new data storage file format is discovered with the extension KDB. In addition to being stored in a custom format, the contents are encoded with the LFSR algorithm seen in Challenge 1, so all of the data contained in the file format must also be decoded once extracted. Using the provided spec on the next page, create a program that extracts and decodes the enclosed data. Your program should accept a path to a KDB file via command line argument. Your program should report the extracted, decoded information to standard out with each entry (name and stored information) on a separate line. Included is a sample KDB file named “store.kdb”. The initial value for the LFSR algorithm is Ox4F574154.. Submit: The source code of your solution AND a text file containing the standard out when your solution is run with store.kdb as its input. MacBook Pro … 14 Fri ools Window Help 2018 Challenges.pdf (page 4 of 5) Q Search KDB File Specification HEAD “CT2018” BYTE[6] MAGIC Pointer to the ENTRY_LIST ENTRY LIST INT32 ENTRY LIST Array of ENTRIES ENTRY[127] ENTRIES ENTRY Null terminated string Pointer to the BLOCK_LIST CHAR[16] NAME BLOCK LIST INT32 BLOCK LIST Array of BLOCKS BLOCK[255 BLOCKS BLOCK Length of the BLOCK's data Pointer to the BLOCK's data INT16 SIZE DATA INT32 DATA BYTE An array of bytes DATA N 14 ok Pro Window Help Fri 11:30 2018 Challenges.pdf (page 4 of 5) Q Search DATA INT32 Pointer to the BLOCK's data DATA BYTED An array of bytes DATA All pointers are relative to the beginning of the file The BLOCK's size and all pointers are little endian. All KDB files begin with a HEAD at Oxo, which starts with the magic bytes “CT2018” and contains a pointer to the file's ENTRY LST The ENTRY LIST is an array of up to 127 ENTRIES. The value OxFFFFFFF signifies the end of the ENTRY LIST Each ENTRY has an ASCII encoded, null terminated name and a pointer to the ENTRY's BLOCK_UST The BLOCK LIST is an ordered array of BLOCKS. The value OxFEFFFFFF signifies the end of the BLOCK_UST. Each BLOCK contains a pointer to that BLOCK's DATA and the size of that DATA The DATA is an LFSR (from Challenge 1) encoded byte array. All BLOCKS from an ENTRY are combined then decoded to reveal the stored information. Page 4 of 5 14 MacBook Pro Anonymous answered this 1,861 answers Was this answer helpful dinclude unsigned char Crypt(unsigned char data, int datalength, unsigned int initialValue long m OXE2089EAS; /Holds the value that will serve as the modulus long x-initialValue; Holds current 'value' that is squared and modulus'd by r int i; Moop counter m fori 0; iChegg Study Textbook Solutions Expert Q&A Teromrdaay int main0 unsigned char”data; int datalength 5; int i; //loop counter data 0] 'a'; data(1] p' data(2] p'; data(3] datal4] 'e' = Il data[O] Ox3a; l data[1) Oxcb; l data(2] Ox68; l data[3) Ox10; l data 4] Ox84; unsigned int initialValue 65536; lunsigned int initialValue Ox12345678; std::cout << Crypt(data, datalength, initialValue) << “10” return 0; Comment> 16 MacBook Pro