Results 1 to 2 of 2
Thread: Protecting a file
- 10-21-2010, 08:15 PM #1Member
- Join Date
- Jul 2010
- Lima, Peru
- Rep Power
Protecting a file
I have created a custom data file in java. It basically contains one long String that represents a data structure I need for my program. However, I want to make this file be safe and to have nobody be able to open it in Notepad or whatever, and read its contents (even if those contents are a bit scrambled).
I tried using a password, but what's the use if I can open the file with Notepad/Wordpad and read the raw data?
I tried doing a custom encryption scheme on the file. However, it turned out the operation took too long. I don't want to have to encrypt the whole file every time every time I save it. I want it to save fast, or at least fast enough that I don't have to wait for it to save.
So my question is.
-Is there a way to lock my file so that it cannot be opened by an external program, and can only be accessed from my program? This is my ideal solution.
-Alternatively, are there ways to encrypt the whole file that do not take long? (I am not familiar with Java classes for encryption. So far I have done my own custom encryption.)
- 10-22-2010, 07:15 AM #2
You can't prevent editing or deleting a file. What you can do is use a database that requires a username and password to connect.
That still doesn't prevent the database itself being deleted.
If you are on Windows, and the filesystem is NTFS, you can hide your data in the alternate stream of an innocent-looking file. Search the net for NTFS alternate streams to know more. Still doesn't save the host file from deletion though.
You might get better suggestions if you can explain the nature of the sensitive data you're trying to protect.
- By maheshsardar in forum Java AppletsReplies: 1Last Post: 08-04-2010, 03:24 PM
- By msegmx in forum Advanced JavaReplies: 0Last Post: 07-15-2010, 01:23 PM
- By paul21 in forum Advanced JavaReplies: 3Last Post: 12-18-2009, 11:36 AM
- By mahendra.athneria in forum New To JavaReplies: 0Last Post: 02-11-2009, 09:53 AM
- By padmajap13 in forum Advanced JavaReplies: 7Last Post: 05-23-2008, 03:46 AM