• Post Reply Bookmark Topic Watch Topic
  • New Topic

Question about RandomFileAccess.  RSS feed

 
Aces Kok Ben
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I read on the internet that the RandomFileAccess API could help one to code functions that could securely delete files inside a file System. How does it work? What are some uses of the RandomFileAccess class? I only know it could read file and "edit" the file at random time?
 
Campbell Ritchie
Marshal
Posts: 56529
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please quote where you read that. You can find out about file I/O here in the Java Tutorials, and there is a section about random access files.
 
Anayonkar Shivalkar
Bartender
Posts: 1558
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aces Kok Ben wrote:I read on the internet that the RandomFileAccess API could help one to code functions that could securely delete files inside a file System. How does it work? What are some uses of the RandomFileAccess class? I only know it could read file and "edit" the file at random time?

Do you mean to say java.io.RandomAccessFile?
 
Aces Kok Ben
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anayonkar Shivalkar wrote:
Aces Kok Ben wrote:I read on the internet that the RandomFileAccess API could help one to code functions that could securely delete files inside a file System. How does it work? What are some uses of the RandomFileAccess class? I only know it could read file and "edit" the file at random time?

Do you mean to say java.io.RandomAccessFile?


Yeah. I do mean that.
 
Campbell Ritchie
Marshal
Posts: 56529
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And where did it say you can delete files? Please quote the website.
 
Aces Kok Ben
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:And where did it say you can delete files? Please quote the website.


Sorry I didn't saw your reply previously. It is here: http://stackoverflow.com/questions/858036/how-to-securely-delete-files-in-java
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aces Kok Ben wrote:I only know it could read file and "edit" the file at random time?

random time or random places?
 
Aces Kok Ben
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seetharaman Venkatasamy wrote:
Aces Kok Ben wrote:I only know it could read file and "edit" the file at random time?

random time or random places?


I'm not sure. I'm confuse, how does RandomFileAccess create secure file delete?
 
Paul Clapham
Sheriff
Posts: 22819
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aces Kok Ben wrote:I'm not sure. I'm confuse, how does RandomFileAccess create secure file delete?


I don't know why you ask that, because the link you posted contains a code example.

Anyway, that code example overwrites the contents of the file with some values (check the listing for details) before deleting the file. That's more secure than just deleting the file, because there are tools which can scan a disk and find disk sectors which belonged to files which have been deleted. These sectors could have data which was supposed to be secure.

Does that help? I couldn't tell whether you were asking how the file got deleted or whether you were asking what "secure file delete" means or what. If what I posted didn't happen to cover your actual question, don't hesitate to ask it again. In different words.
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aces Kok Ben wrote:I'm not sure. I'm confuse, how does RandomFileAccess create secure file delete?

I'm not at all sure it does; although it might allow you to 0 out a file's contents. Secure file deletion utilities do a lot of stuff besides just that; and much of it is very system-, fs-, or even disk- centric. In Java, you're always one step removed from the system anyway, and it would be extremely simple for an admin to simply deny your program permission to do what it wants; so I suspect you're on to a non-starter here.

Winston
 
Aces Kok Ben
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:
Aces Kok Ben wrote:I'm not sure. I'm confuse, how does RandomFileAccess create secure file delete?


I don't know why you ask that, because the link you posted contains a code example.

Anyway, that code example overwrites the contents of the file with some values (check the listing for details) before deleting the file. That's more secure than just deleting the file, because there are tools which can scan a disk and find disk sectors which belonged to files which have been deleted. These sectors could have data which was supposed to be secure.

Does that help? I couldn't tell whether you were asking how the file got deleted or whether you were asking what "secure file delete" means or what. If what I posted didn't happen to cover your actual question, don't hesitate to ask it again. In different words.


Sorry to all repliers. I think I didn't start my question properly(I was rushing to post the question and log off the computer the other day). I was asked to code some java security application, in which one of the functions requires me to come out with a class / method that will allows me to delete file securely, without leaving any trace inside the flashdrive. The function should delete the file securely, in which I mean even if someone else try to use 3rd party software(Forensic software) to scan the flashdrive, it will make it difficult, or nearly impossible for it to scan for the traces of the deleted file.

Because of that, I went online to search for the term "Secure file delete" and I found those codes online. This is when I got confuse, and I'm unsure if the code will really work.
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aces Kok Ben wrote:I was asked to code some java security application, in which one of the functions requires me to come out with a class / method that will allows me to delete file securely, without leaving any trace inside the flashdrive. The function should delete the file securely, in which I mean even if someone else try to use 3rd party software(Forensic software) to scan the flashdrive, it will make it difficult, or nearly impossible for it to scan for the traces of the deleted file.

And that's why I say I doubt if Java is the right choice. Depending on whether it's a flash drive or a portable, the requirements may be different; for example, with magnetic media, you may have to overwrite several times; and I suspect Java is just too far removed from the system itself to determine things like that. It's also worth noting that secure deletion can reduce the life of your drive.

Winston
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!