Binary Data File? 
Author Message
 Binary Data File?

Hi all!
I am writing an application that reads and writes data to a file. But I would
like to make that file readable only to my application and not to anyone with a
text editor.  I keep hearing of a binary data file, but have been unsuccessful
in finding any information on how to create such an animal.  I have only found
information on reading and writing to files with a binary access method, but
the data in the file is still readable from a text editor.  I thought about
using a database format, but am wondering if that would significantly add to
the size of the datafile (I am trying to keep the app as tight as possible).

I am also looking for information on how to write a POP(3) mail client or if
there are vbx's available for this.

Any help or insights would be greatly appreciated.

Thanks in advance for your help.

Dean



Sat, 27 Dec 1997 03:00:00 GMT  
 Binary Data File?
To create file, you can use:

   Open "filename" for output as #1

then to read/write to the file use:

    Open "filename" For Binary As #1
    Put #1, byte_pos&, record_text

I don't think there is much distinction between a text file
and a binary file, except that text files are assumed to
contain ASCII printable characters where the record is
terminated by a carriage return, linefeed..  Which means
that text editors can read binary files.  If the file contains
printable characters then the editor will display them.
To make a file "unreadable" you would need to
encrypt the file so that each byte is a binary number
which would make the file look like garbage to someone
reading  the file with an editor.

A typical encryption method is to create a checksum by
adding all the bytes of the file togethter.  Add the checksum
to the end or beginning of the file.  Use the last byte of the checksum as mask,
and XOR the mask to all the btyes (except the checksum) in the file.
Then when reading the file, get the checksum, and the mask and
XOR the mask to to all the bytes (to get back the orinial character).

Bob



Sat, 27 Dec 1997 03:00:00 GMT  
 Binary Data File?

Quote:

>Hi all!
>I am writing an application that reads and writes data to a file. But I would
>like to make that file readable only to my application and not to anyone with a
>text editor.  I keep hearing of a binary data file, but have been unsuccessful
>in finding any information on how to create such an animal.  I have only found
>information on reading and writing to files with a binary access method, but
>the data in the file is still readable from a text editor.  I thought about
>using a database format, but am wondering if that would significantly add to
>the size of the datafile (I am trying to keep the app as tight as possible).

If you don't want the users to see what you are doing then you are going
to have to encrypt it.  An Access database is an easy way to do this.

A binary file refers to storing numbers in in their binary representation
rather than text.  Text in binary format looks like text in text format.

John



Sat, 27 Dec 1997 03:00:00 GMT  
 Binary Data File?

Quote:

>>I am writing an application that reads and writes data to a file. But I would
>>like to make that file readable only to my application and not to anyone
>>with a text editor.  I keep hearing of a binary data file, but have been
>>unsuccessful in finding any information on how to create such an
>>animal.  I have only found information on reading and writing to files
>>with a binary access method, but the data in the file is still
>>readable from a text editor.  I thought about using a database format,
>>but am wondering if that would significantly add to
>>the size of the datafile (I am trying to keep the app as tight as
>>possible).
>If you don't want the users to see what you are doing then you are going
>to have to encrypt it.  An Access database is an easy way to do this.

Yes, but he doesn't want to expand the size of the app.

Quote:
>A binary file refers to storing numbers in in their binary representation
>rather than text.  Text in binary format looks like text in text format.

How secure does this have to be? XOR encryption is probably good enough
*IF* the key is the size of the file. After even 4 or 5 key repetitions,
the file is a cinch to unencrypt. Well, you could always get the source
to PGP... :)
--
_________________________________________________________
Robert Woodcock | Note: Your standard disclaimers apply. |

................| it can be quite a curse) - Plucky Duck |


Sat, 27 Dec 1997 03:00:00 GMT  
 Binary Data File?

Quote:
>A typical encryption method is to create a checksum by
>adding all the bytes of the file togethter.  Add the checksum
>to the end or beginning of the file.  Use the last byte of the checksum as mask,
>and XOR the mask to all the btyes (except the checksum) in the file.
>Then when reading the file, get the checksum, and the mask and
>XOR the mask to to all the bytes (to get back the orinial character).

Anyone with *any* experience in cracking stuff would figure this out in 5
minutes. In a 1000 byte file, you'd have 1000 key repetitions. A cheap
hackers's program would then just XOR the stuff with different keys until
it made sense, or if they knew about your checksum thing, it'd be a
piece of cake. You need to generate a key the size of the file, and XOR
*that* to the file.

--
_________________________________________________________
Robert Woodcock | Note: Your standard disclaimers apply. |

................| it can be quite a curse) - Plucky Duck |



Sat, 27 Dec 1997 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Write ADO Field containing binary data (files) to the file system

2. Binary Data File?

3. Binary Data Files

4. Binary data files - are these "secure"?

5. Loading binary data file into SQL Server

6. Any way I can create/read/write Binary Data Files for saving data via VB without using Any Database Engine or Access Database ?

7. How to put large binary data files into a DB via ODBC ?

8. Binary Data in SQL 2000/Conver to Bitmap Data For Data Grid View

9. Write image data as binary to append existing file

10. Write data in binary file / Convert Image

11. Moving Binary Data between files fast!

12. Moving Binary data between files quickly.

 

 
Powered by phpBB® Forum Software