Results 1 to 5 of 5

Thread: Read/Write to Encrypted file without Decrypting the whole file - possible?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2009
    Location
    Uk
    Posts
    157

    Read/Write to Encrypted file without Decrypting the whole file - possible?

    I have an encrypted sqlite database which decrypts when my application starts and encrypts when the app closes down - it is encrypted using the Rijndael method

    Currently the data is retrieved by my application when the database is decrypted into a separate file

    Is it possible to read/write to the encrypted database without decrypting the whole database into a separate file as once it is decrypted it contains data which my competitors could use?

  2. #2
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Read/Write to Encrypted file without Decrypting the whole file - possible?

    No!

    That should be obvious. Encryption does not run like a cipher with a one to one relationship between characters. It is a complex calculative process operating on a single entity - the database file in this case. You can no more tease out parts of the encrypted file than you can unbake a cake!

    But, unless you're working for the CIA (and possibly even then), encrypting a database is frankly ludicrously paranoid in the first place. If there are parts of your database that can be read direct from the file (which I very much doubt) then change your database supplier.
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Feb 2009
    Location
    Uk
    Posts
    157

    Re: Read/Write to Encrypted file without Decrypting the whole file - possible?

    Ok what i'm thinking then is to encrypt one table of data inside the database and not the whole database file itself. I've spent months creating the data and don't want a competitor to easily open the database and copy/paste the data into their own database

    The important data would only need to be read from the database, so what would be the best encryption method for this - MD5/AES?

  4. #4
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,904

    Re: Read/Write to Encrypted file without Decrypting the whole file - possible?

    There are implementations of sqlite which supports encryption. Maybe check this out http://www.sqlite.org/support.html

  5. #5
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Read/Write to Encrypted file without Decrypting the whole file - possible?

    I've spent months creating the data and don't want a competitor to easily open the database and copy/paste the data into their own database
    Then don't release your program. You can encrypt the data as much as you like, bury it under concrete and surround it with guards, but at some point, unless it's only used in background operations and never actually sees the light of day, it will become available to anyone who uses your program.

    As Arnoutdv has indicated there are some database engines that will encrypt data in addition to normal obfuscation. It's really not something you can do for yourself on an ad hoc basis.
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

Posting Permissions

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



Click Here to Expand Forum to Full Width