R
R
Roman Sopov2012-12-17 15:04:28
C++ / C#
Roman Sopov, 2012-12-17 15:04:28

C++ How to permanently delete a file?

I'm looking for a way, or rather a code or a library for C ++ so that you can delete a file without the possibility of recovery.
OS: Win, Mac

Thanks!

Answer the question

In order to leave comments, you need to log in

5 answer(s)
A
agmt, 2012-12-17
@agmt

If for you clogging the entire file with random bytes gives an insufficient guarantee, then store such files on a USB flash drive, and use not C ++, but a hammer and an oven to delete them. SSD at any time of wiping can reassign memory areas so that neither 1 nor 101 times will overwrite information.

0
0xA0, 2012-12-17
@0xA0

I solved this problem by rubbing the file 7 times (you open the file and write there) with random values.
The states even have a document, such as "secret information must be deleted like this." If necessary, I will throw off the code under Win

O
ov7a, 2012-12-17
@ov7a

Isn't it easier to open, fill with random bytes, close and delete with regular means?

R
Roman Sopov, 2012-12-18
@sopov

agmt , if our file is encrypted, then we can read and write data ... but for example, we will not be able to open a .doc file i.e. we need to first decrypt it, save it and only then open it.
e-nigma has certificates for cryptography, that it complies with GOST and there are no bookmarks in it.

@
@sledopit, 2012-12-19
_

If you really need the code, then look at the Linux shred sources.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question