Making self-deleting files

A place to discuss the implementation and style of computer programs.

Moderators: phlip, Moderators General, Prelates

GreenStormElf
Posts: 27
Joined: Sat Aug 22, 2009 1:21 am UTC

Making self-deleting files

Postby GreenStormElf » Thu Jan 07, 2010 6:14 am UTC

I'm a complete noob about all of this stuff, so please explain slowly.

Is there any way to create a file that will self-destruct after a certain time period, or with a certain stimulus? For instance, emailing someone a music file that deletes itself after two days, but still appears to be an .mp3.

Also, how would I write a program that deletes a certain file with a known filepath?

Would there be some way of using a search function inside that program?

I don't have any real world pressing need for this, but it strikes me as a useful ability. I don't intend to do anything malicious.

User avatar
jroelofs
Posts: 77
Joined: Tue Apr 01, 2008 9:26 pm UTC
Location: Nashua, NH
Contact:

Re: Making self-deleting files

Postby jroelofs » Thu Jan 07, 2010 6:34 am UTC

Google for "shell scripting" for the last three. I'm not entirely sure that the first is possible, but I'm amazed every day at the things people can do with viruses.

GreenStormElf
Posts: 27
Joined: Sat Aug 22, 2009 1:21 am UTC

Re: Making self-deleting files

Postby GreenStormElf » Thu Jan 07, 2010 6:41 am UTC

Thanks.

Does anyone know how to do the first one?

Also, could someone tell me how to just write a basic delete file script please.

User avatar
Berengal
Superabacus Mystic of the First Rank
Posts: 2707
Joined: Thu May 24, 2007 5:51 am UTC
Location: Bergen, Norway
Contact:

Re: Making self-deleting files

Postby Berengal » Thu Jan 07, 2010 8:04 am UTC

GreenStormElf wrote:Also, could someone tell me how to just write a basic delete file script please.

Code: Select all

#!/bin/bash
rm -f $1
It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.

Axidos
Posts: 167
Joined: Tue Jan 20, 2009 12:02 pm UTC
Location: trapped in a profile factory please send help

Re: Making self-deleting files

Postby Axidos » Thu Jan 07, 2010 8:11 am UTC

#1: No. There is no possible way for files to delete themselves. It's not how a file works (unless the file is a program, and the program is programmed to delete itself).

You might as well tell someone to fasten a screw on a screwdriver using the screwdriver itself... it's not exactly designed for that sort of thing*, and neither are files designed to delete themselves.


* Unless you have a portal gun.

User avatar
jroelofs
Posts: 77
Joined: Tue Apr 01, 2008 9:26 pm UTC
Location: Nashua, NH
Contact:

Re: Making self-deleting files

Postby jroelofs » Thu Jan 07, 2010 8:48 am UTC

You could have a hidden program somewhere that deletes the file after some condition, but that seems a bit too virusey. If all you want to do is protect music from being copied, I'd suggest looking into DRM, or digital rights management. Wait a minute... that's exactly what you are looking for. With some forms of DRM, you can make it so that music can only be played during a certain time-frame.

MysteryBall
Posts: 314
Joined: Wed Jul 29, 2009 2:47 pm UTC

Re: Making self-deleting files

Postby MysteryBall » Sun Jan 10, 2010 11:57 am UTC

jroelofs wrote:You could have a hidden program somewhere that deletes the file after some condition, but that seems a bit too virusey. If all you want to do is protect music from being copied, I'd suggest looking into DRM, or digital rights management. Wait a minute... that's exactly what you are looking for. With some forms of DRM, you can make it so that music can only be played during a certain time-frame.


I would remember, though, that DRM is more of a pest than an inhibitor, a minor annoyance to those who know how to bypass it, and a pain in the ass to those who legitimately have that file. DRM has always been a pain to those who obtained things legitimately, and easily removed by those who were not so legitimate.

cogman
Posts: 112
Joined: Sun May 18, 2008 2:17 pm UTC

Re: Making self-deleting files

Postby cogman » Mon Jan 11, 2010 12:50 am UTC

The program executing the file would have to somehow execute code within said file. For that to happen you need the file to either
A. Be some sort of document that supports scripting of some sort, IE macros in excel.
or
B. the program would have to have some serious security flaw like an overflowing buffer, in which case it may not work from one version of the program to the next.

You could trick the person to executing an executable which drops the file to be played, opens the default program to play that file, and then deletes the file/itself (or whatever) but that has so many flaws and "what-ifs" that it really just isn't that feasible (any more)

In short, no, not really.

mroctogon
Posts: 17
Joined: Fri Feb 29, 2008 1:26 am UTC

Re: Making self-deleting files

Postby mroctogon » Mon Jan 11, 2010 3:38 am UTC

You may want to look at this. The idea is that you send an encrypted message, and the decryption key is stored in a distributed hash table network with many many nodes participating. The algorithm works so that after the set timeout, the data becomes unreadable because the key is unavailable. Its pretty amazing stuff if you ask me. Its still a fairly new technology, but its pretty dang amazing.

User avatar
TheChewanater
Posts: 1279
Joined: Sat Aug 08, 2009 5:24 am UTC
Location: lol why am I still wearing a Santa suit?

Re: Making self-deleting files

Postby TheChewanater » Mon Jan 11, 2010 5:05 am UTC

mroctogon wrote:Its pretty amazing stuff if you ask me.

It's evil if you ask me.

Of course, this does have legitimate uses, but why would you want a file to delete itself other than to bother users?
ImageImage
http://internetometer.com/give/4279
No one can agree how to count how many types of people there are. You could ask two people and get 10 different answers.

mroctogon
Posts: 17
Joined: Fri Feb 29, 2008 1:26 am UTC

Re: Making self-deleting files

Postby mroctogon » Mon Jan 11, 2010 8:24 am UTC

Its a simple privacy matter. One of the major concerns with the web is how nothing ever goes away. All data is effectively permanent. Some things are not meant to be permanent. I'm not talking about restricting music or movies or whatnot. I really could care less about that. I am talking about simple privacy.

Of course if somebody can legitimately read data at any time, there is really nothing stopping them from making a more permanent copy of it and saving or publishing it. The human factor always ruins these things.

Axidos
Posts: 167
Joined: Tue Jan 20, 2009 12:02 pm UTC
Location: trapped in a profile factory please send help

Re: Making self-deleting files

Postby Axidos » Mon Jan 11, 2010 1:01 pm UTC

Vanish looks like it's just another (kind of weak) DRM since it relies on a program.
Create file, break up and distribute decryption key to various sources. To access file, recover key pieces from sources, reassemble, decrypt file. Exactly what is stopping me from storing the key and thus accessing the not-so-self-destructing data permanently with it?

Ended
Posts: 1459
Joined: Fri Apr 20, 2007 3:27 pm UTC
Location: The Tower of Flints. (Also known as: England.)

Re: Making self-deleting files

Postby Ended » Mon Jan 11, 2010 5:23 pm UTC

Axidos wrote:Exactly what is stopping me from storing the key and thus accessing the not-so-self-destructing data permanently with it?
Yeah, pretty much nothing. It's designed to thwart retroactive attackers, e.g. people seeking to subpoena documents after the fact, so it's not quite what the OP wants. The paper [pdf] is a fascinating read, though.
Generally I try to make myself do things I instinctively avoid, in case they are awesome.
-dubsola

halo
Posts: 1
Joined: Thu Dec 05, 2013 1:43 am UTC

Re: Making self-deleting files

Postby halo » Thu Dec 05, 2013 1:53 am UTC

well in stead of deleting the whole thing you can corrupt it. as you may know that notepad (and mac equivalent) can open any file but .doc(x) or .jpg or .mp3 will all show up as a bunch of random characters like "#@%$#&%$*%^lahbrfaAF+_)*(%&$" by deleting even one of those characters the file will be corrupted. im not sure how to attach the kill code to the real file and set a timer but it is very possible.


sources: (i am in highschool) and when there is a class presentation or some thing due i get by making this file and blaming technology so the teacher has to give me an extention

flownt
Posts: 70
Joined: Sat Feb 09, 2013 5:24 pm UTC

Re: Making self-deleting files

Postby flownt » Thu Dec 05, 2013 10:59 pm UTC

Yes the "attaching the kill code" is the entire problem, Halo. You haven't brought anything new to this thread, which, by the way, was dead for almost four years, before you had to chime in. As the other posters have already mentioned, attaching such a switch is, because of the possible miscunduct, much like a virus and therefore impossible (without a helping had from the user).

elasto
Posts: 3575
Joined: Mon May 10, 2010 1:53 am UTC

Re: Making self-deleting files

Postby elasto » Sat Dec 07, 2013 2:56 pm UTC

The bump was good in that I got to read about Vanish though - and I find it interesting that the project has basically gone nowhere in the last four years; I would have thought it'd actually be a really useful concept. Why isn't it (or something better) built into gmail for example?

flownt
Posts: 70
Joined: Sat Feb 09, 2013 5:24 pm UTC

Re: Making self-deleting files

Postby flownt » Sun Dec 08, 2013 5:31 pm UTC

Because circumvention is basically trivial?

elasto
Posts: 3575
Joined: Mon May 10, 2010 1:53 am UTC

Re: Making self-deleting files

Postby elasto » Mon Dec 09, 2013 2:49 am UTC

What do you mean? Yes, it's easy for the recipient to make a permanent copy if that's what you're referring to, but it's not the goal of the tech to prevent that (have you read the pdf?) The purpose is to prevent a third-party from reading a private correspondence after the point of expiry. That has loads of legitimate applications.

Well, now we're all living in this post-Snowden world, maybe people will start caring about privacy some more.


Return to “Coding”

Who is online

Users browsing this forum: No registered users and 9 guests