-
2
- #1
faq102-7528
I posted another piece of code to the FAQ section, along with example usage. This is a component that overwrites files with patterns and then deletes them (or "secure erase"). It takes the file size, figures out the cluster size, and overwrites that with specific patterns. I coded the three more common ones that I see in other programs that do this (near as to what I could figure out).
It's also threaded with relatively light requirements otherwise so it should be a good example of how to use threads in this situation. I tried to use some OO design on the "secure erase" code itself, and hopefully presents a good example of that.
TSDBaseObject => base object for secure erase (TThread). Has all the relevant methds and values to do the task. The plan with this class was to force an EraseFile method to be defined for whatever scheme one wanted to code out of its descendants and have all necessary code to implement that method here.
TSDZeroErase, TSDDodErase, TSDGutmannErase => descendants of TSDBaseObject to do various specific erasing patterns/passes.
TSecureDelete => the component implementation.
It is not possible for anyone to acknowledge truth when their salary depends on them not doing it.
I posted another piece of code to the FAQ section, along with example usage. This is a component that overwrites files with patterns and then deletes them (or "secure erase"). It takes the file size, figures out the cluster size, and overwrites that with specific patterns. I coded the three more common ones that I see in other programs that do this (near as to what I could figure out).
It's also threaded with relatively light requirements otherwise so it should be a good example of how to use threads in this situation. I tried to use some OO design on the "secure erase" code itself, and hopefully presents a good example of that.
TSDBaseObject => base object for secure erase (TThread). Has all the relevant methds and values to do the task. The plan with this class was to force an EraseFile method to be defined for whatever scheme one wanted to code out of its descendants and have all necessary code to implement that method here.
TSDZeroErase, TSDDodErase, TSDGutmannErase => descendants of TSDBaseObject to do various specific erasing patterns/passes.
TSecureDelete => the component implementation.
It is not possible for anyone to acknowledge truth when their salary depends on them not doing it.