Results 1 to 2 of 2
  1. #1
    PrinceSendai is offline Member
    Join Date
    Jul 2010
    Location
    Lima, Peru
    Posts
    47
    Rep Power
    0

    Question 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.)

    Thanks!

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is online now Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,300
    Rep Power
    20

    Default

    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.

    db

Similar Threads

  1. Replies: 1
    Last Post: 08-04-2010, 03:24 PM
  2. Replies: 0
    Last Post: 07-15-2010, 01:23 PM
  3. protecting and tracking
    By paul21 in forum Advanced Java
    Replies: 3
    Last Post: 12-18-2009, 11:36 AM
  4. Replies: 0
    Last Post: 02-11-2009, 09:53 AM
  5. Replies: 7
    Last Post: 05-23-2008, 03:46 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •