This shorter video encompasses writing the sequence to create the initial block for an entry and populate it with a byte sequence. And then we write the code to encrypt the block and append it to the current data file.
I made a mistake when writing to the new block. Instead of setting byte 1 to byte 12 to random values, set the entire first 12 bytes to some arbitrary nonzero constant. We want to avoid random values because there is the possibility of generating a zero, which would be read as the end of an entry. And we set all the bytes to that nonzero constant because when iterating over the block to find a new place to write, we will scan the block backwards to find a zero. The loop will also terminate when the index is out of bounds. After the loop, we increment the index to start writing. If the index goes to -1, the loop stops and incrementing it will bring it to 0, where we want to start writing data.
*** Make sure to check the two GitHub commits before this one that include crucial fixes.
• Website: https://michaelg29.github.io/
• Twitter: / michaelgrieco10
• Discord: / discord
• This Github Repo: https://github.com/michaelg29/data-vault
• This Playlist: • Data Vault (C)
• GitHub Commit: https://github.com/michaelg29/data-va...