S
S
Someone01102021-09-11 15:45:10
Python
Someone0110, 2021-09-11 15:45:10

How to implement the DOD method or Guttmann's data erasure method in Python?

Hello, how can I implement the Guttman or DOD method in Python? Are there any modules or algorithms? For example, if I want to overwrite a certain file?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
hint000, 2021-09-11
@Someone0110

You don't implement this in Python.
More low-level disk access is needed. below the file system. Access to the disk as a block device.
And you need to know the specific file system on which the file is located. If you want to do it on different file systems (EXT4, EXT3, EXT2, BTRFS, ZFS, NTFS, FAT32,..), then you have to learn all these systems. And implement it in some C/C++/C#.

Z
Zettabyte, 2021-09-12
@Zettabyte

If you want to overwrite the entire disk, then I do not exclude that you will succeed in this.
Here is an article about direct access to a hard disk from Python: https://habr.com/ru/post/274195/ and the code for it: https://github.com/kazenniy/atapt
By the way, overwrite in some special way there is no point, it is enough to go through one layer of random data.
If you want to overwrite specific files, folders, etc., then your task becomes much more complicated - you need to parse the structures of file systems.
You can try to use libraries like this one (NTFS), but I can’t say anything about them, there was no need to experiment with something like this: https://github.com/williballenthin/python-ntfs

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question