1. Homepage
  2. Programming
  3. Programming Challenges: Data Obfuscation

Programming Challenges: Data Obfuscation

Engage in a Conversation
Data ObfuscationKDBLinear Feedback Shift RegisterLFSRCT2018C

Challenge 1: A common technique for obfuscating data is to use exclusive-or (XOR) with some key; it is in expensive and symmetric. CourseNana.COM

A problem occurs when this is used on file formats like portable executable where there are many null bytes, since XORing nulls with the key ends up writing the key out. CourseNana.COM

A slightly more complex algorithm uses a Linear Feedback Shift Register (LFSR) to produce a key stream which will be XORed with the data. A generic LFSR is: CourseNana.COM

If F is the value which represents the LFSR feedback and S is the current state of the LFSR, the nextstate of the LFSR is computed as follows: if the lowest bit of S is 0: s = S >> 1 if the lowest bit of S is 1: s = (s >> 1) ^ F For this challenge, you'll be using an LFSR with the feedback value 0x87654321. The LFSR is initialized with a value and stepped to produce the key stream. The next key value is read from the lFSR after eightsteps, with the actual key being the lowest byte of the current LFSR value. For example, if the initial value of the LFSR is 0xFFFFFFFF, then next value after stepping it eight times will be 0x9243F425, meaning that the first key byte is 0x25. lf the first byte of the input is 0x41, the first byte of output will be 0x64. Your task is to implement this algorithm (both LFSR and the XOR). We're only interested in algorithm implementation; other code will be discarded. The function should adhere to one of following signatures: C/C++: unsigned char Crypt(unsigned char data, int datalength, unsigned intinitialValue) C#: static byte[] Crypt(byte[] data,uint initialValue) Python: Crypt(data: bytes, initialValue: int) -> bytes Java: static byte[] Crypt(byte[] data, long initialValue) CourseNana.COM

Example Tests: data: "apple" dataLength: 5 initialValue: 0x12345678 result: "xCD\x01\xEFxD7x30" CourseNana.COM

data: "xCD\x01\xEFxD7x30" dataLength: 5 initialValue: 0x12345678 result: "apple" CourseNana.COM

Submit: Source code containing your implementation of the LFSR based encoding routine. CourseNana.COM

Challenge 2: 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. Usingthe 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 "storekdb", The initial value for the LFSR algorithm is 0x4F574154. Submit: The source code of your solution AND a text file containing the standard out when your solutionis run with store.kdb as its input. CourseNana.COM

KDB File Specification

    HEAD

MAGIC BYTE[6) “CT2018” CourseNana.COM


ENTRY LIST* INT32 Pointer to the ENTRY_LIST CourseNana.COM



    ENTRY LIST

ENTRIES ENTRY[127] Array of ENTRIES CourseNana.COM



    ENTRY

NAME CHAR[16] Null terminated string CourseNana.COM


BLOCK LIST* INT32 Pointer to the BLOCK_LIST CourseNana.COM



    BLOCK_LIST

BLOCKS BLOCK[255] Array of BLOCKS CourseNana.COM



    BLOCK

SIZE INT16 Length of the BLOCK's data CourseNana.COM


DATA* INT32 Pointer to the BLOCK's data CourseNana.COM



    DATA

DATA BYTE[] An array of bytes CourseNana.COM


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 0x0, which starts with the magic bytes "CT2018" and containsa pointer to the file's ENTRY_LIST. The ENTRY_LIST is an array of up to 127 ENTRIES. The value OxFFFFFFFF signifies the end of the ENTRY_LIST. Each ENTRY has an ASCll encoded, null terminated name and a pointer to the ENTRY's BLOCK_LIST. The BLOCK_LIST is an ordered array of BLOCKS. The value 0xFFFFFFFF signifies the end of the BLOCK_LIST. 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 arecombined then decoded to reveal the stored information. CourseNana.COM

Challenge 3: Obfuscated JPEGS During the same forensic investigation, multiple obfuscated JPEGs were discovered. All JPEGs start with the bvtes FF D8 FF, but in this case, these bytes were changed to prevent applications from recognizing the files as JPEGs. All of these JPEGs are guaranteed to end with the standard magic bytes FF D9. CourseNana.COM

The investigation requires that these JPEGs be identified and the initial bytes repaired so they can be viewed. ldentifving the JPEGs should be a trivial task, but none of our tools are set up to recognize the custom header. Create a tool that, given an input file, can detect, extract, repair, and save these obfuscated JPEGs This process is commonly known as file carving (with simple file repair). CourseNana.COM

Your program should accept a path to a KDB file followed by another file path via command line arguments. Your program should load the magic bytes from the KDB file's entry named "MAGiC" using the algorithm from Challenge 2. This file does not contain any obfuscated JPEGs. Your program should detect all JPEG files with the custom magic bytes that are present in the second provided file. Your program should NOT attempt to detect JPEGs not starting with the custom magic bytes. Your program should replace the custom magic bytes from the KDB with the standard ones (FF D8 FF). Your program should output all repaired JPEGs to a directory “_Repaired" in the same directory as the input file. Your program should save the repaired JPEGs with the filename ".jpeg”. Your program should report to standard out the offset at which it detected each file, the file's size, the file's MD5 hash (after it is repaired), and the path of the corresponding output file. Your program should NOT attempt to OCR the repaired JPEGs to find the hidden message; just view them yourself. CourseNana.COM

Your solution to this challenge may not make use of any existing library for parsing JPEG files, file carving, file typing, or steganography. You may (and will probably want to) use an existing MD5 implementation. CourseNana.COM

Included is a sample input file named "input.bin" that contains three valid JPEGs and the corresponding KDB file "magic.kdb". CourseNana.COM

Submit: The source code of your solution AND a text file containing the contents of standard out when your solution is run with magic.kdb and input.bin as its input AND a text file containing the now visible "messages" in the repaired JPEGs Do NOT submit the repaired JPEGs. CourseNana.COM

Get in Touch with Our Experts

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
Data Obfuscation代写,KDB代写,Linear Feedback Shift Register代写,LFSR代写,CT2018代写,C代写,Data Obfuscation代编,KDB代编,Linear Feedback Shift Register代编,LFSR代编,CT2018代编,C代编,Data Obfuscation代考,KDB代考,Linear Feedback Shift Register代考,LFSR代考,CT2018代考,C代考,Data Obfuscationhelp,KDBhelp,Linear Feedback Shift Registerhelp,LFSRhelp,CT2018help,Chelp,Data Obfuscation作业代写,KDB作业代写,Linear Feedback Shift Register作业代写,LFSR作业代写,CT2018作业代写,C作业代写,Data Obfuscation编程代写,KDB编程代写,Linear Feedback Shift Register编程代写,LFSR编程代写,CT2018编程代写,C编程代写,Data Obfuscationprogramming help,KDBprogramming help,Linear Feedback Shift Registerprogramming help,LFSRprogramming help,CT2018programming help,Cprogramming help,Data Obfuscationassignment help,KDBassignment help,Linear Feedback Shift Registerassignment help,LFSRassignment help,CT2018assignment help,Cassignment help,Data Obfuscationsolution,KDBsolution,Linear Feedback Shift Registersolution,LFSRsolution,CT2018solution,Csolution,