Just for the sake of security:
A file extension can help Windows identify and associate a file with a particular application, but the file extension itself doesn't protect the file from being edited or read. I could make a text file named test.txt or test.dfg or test.001ofg and I could open them all in notepad and change them.
If the data is binary, a halfway decent hex editor is all you would need to edit the file.
While you can use any file extension you want, in fact you don't even have to use one in DBC, the file extension is not a method of protection - or rather, a very, very, very limited form of protection.
Linux doesn't use file extensions unless there is a need to identify the type of file.
If you were actually interested in protecting the file, you would want to encrypt it somehow or save the data in your own custom format that only your program could read.
Here's a very basic example. It writes a string to a file and also an "encrypted" version to another file. I hesitate to even call it encryption! I used the file extension .txt to show that I could write bytes directly to a file and it doesn't matter what the extension is. To read the file back, I just do the opposite of how I saved it. This is how you could create your own custom format.
`**************************************
`* Title : breakable file encryption
`* Author : latch
`* Date : 09/06/2006
`* Version:
`**************************************
rem --- this will save a string in two formats:
rem --- as a regular string, and as a psuedo encrypted string
rem --- breakable.txt is a regular string
rem --- breakable2.txt is encrypted
rem ------ Set Up Display -------------
autocam off
set display mode 800,600,16
sync on
rem ---check if files exist, delete them if they do
if file exist("breakable.txt") then delete file "breakable.txt"
if file exist("breakable2.txt") then delete file "breakable2.txt"
rem ---enter string to save
Print "Enter a string of text to save in a custom file format"
print "Then press Enter..."
input "String: ";text$
rem ---open a file to write
open to write 1,"breakable.txt"
write string 1,text$
close file 1
print
print "Saved breakable.txt as string..."
open to write 1,"breakable2.txt"
rem ---get number of bytes in the string for
rem ---writing to encrypted file
for byte = 1 to len(text$)
rem --- make each character byte -1 for our encryption
ptr=asc(mid$(text$,byte))-1
write byte 1,ptr
next byte
close file 1
print "Saved breakable2.txt as encrypted string..."
print
print "Press any key to see contents of files"
suspend for key
rem --- read file contents
open to read 1,"breakable.txt"
read string 1,text$
close file 1
print "breakable.txt contents :";text$
open to read 1,"breakable2.txt"
read string 1,text$
print "breakable2.txt contents :";text$
close file 1
print
print "Press any key to decrypt breakable2.txt"
suspend for key
rem --- decrypt breakable2
open to read 1,"breakable2.txt"
for byte = 1 to file size("breakable2.txt")
rem --- read each character byte +1 for our decryption
read byte 1,ptr
ptr=ptr+1
decrypt$=decrypt$+chr$(ptr)
next byte
close file 1
print "breakable2.txt decrypted :";decrypt$
Enjoy your day.