This is a repo for scripts we used for a project in a cryptography class (cpsc 418).
These scripts are very basic and aren't very well written (they use hard coded paths)
There are four scripts here:
418program.sh- we used this to place some known text in memorydecode.sh- handles calling the scripts functions to perform the descrambling.parsingfiles.py- turns the input file into a list series of base64 strings, each representing 64 bytes. Its easier to work with base64 instead of binary.xorkey.py- takes a sorted and deduplicated list of base64 strings, takes the first line, converts it to binary and xors that with the entire memory dump file
The process is:
- we take a scrambled the memory dump
- extract a subsection of it (we used 500MiB)
- convert that subsection into 64-byte base64 strings
- sort the file using
sort(becauseuniqrequires a sorted input) - use
uniqto count and remove duplicate strings - use
sortagain to get the most frequently string - convert that string back into binary
- xor that binary value with the entire memory dump
This was based on a process used in paper "Cold Boot Attacks are Still Hot: Security Analysis of Memory Scramblers in Modern Processors" by Yitbarek Et.Al. https://ieeexplore.ieee.org/document/7920835