Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   Re: Random access to an encrypted file (http://www.velocityreviews.com/forums/t721550-re-random-access-to-an-encrypted-file.html)

Roedy Green 04-27-2010 08:15 AM

Re: Random access to an encrypted file
 
On Mon, 26 Apr 2010 10:41:36 -0500, Spud <fake@fkfkfkf.com> wrote,
quoted or indirectly quoted someone who said :

>We've been told that we need to implement on-disk encryption of our data
>files. We currently write them using RandomAccessFile and read them
>using FileChannel.read(ByteBuffer).
>
>Before I go off on my own, slog through java.security, and write a
>wrapper around these routines to encrypt/decrypt, is there an easy way
>to do it? Perhaps something built into the JDK that I'm missing?


The easy way would be to find a database that does encryption.
see http://mindprod.com/jgloss/sqlvendors.html
for candidates.

The awkward thing about roll your own is the growth factor that
encryption penalises you is not usually accurately predictable.

Check out JCE and benchmark some algorithms. There is quite a
difference in speed. In particular check out the new AES.

See http://mindprod.com/jgloss/jce.html
--
Roedy Green Canadian Mind Products
http://mindprod.com

It’s amazing how much structure natural languages have when you consider who speaks them and how they evolved.

Arne Vajhøj 04-27-2010 11:52 PM

Re: Random access to an encrypted file
 
On 27-04-2010 04:15, Roedy Green wrote:
> On Mon, 26 Apr 2010 10:41:36 -0500, Spud<fake@fkfkfkf.com> wrote,
> quoted or indirectly quoted someone who said :
>> We've been told that we need to implement on-disk encryption of our data
>> files. We currently write them using RandomAccessFile and read them
>> using FileChannel.read(ByteBuffer).
>>
>> Before I go off on my own, slog through java.security, and write a
>> wrapper around these routines to encrypt/decrypt, is there an easy way
>> to do it? Perhaps something built into the JDK that I'm missing?

>
> The easy way would be to find a database that does encryption.
> see http://mindprod.com/jgloss/sqlvendors.html
> for candidates.
>
> The awkward thing about roll your own is the growth factor that
> encryption penalises you is not usually accurately predictable.


I would expect every algorithm to have a very well defined
function for the size after encryption depending on the
size before encryption. 100% predictable.

Arne


Mike Schilling 04-28-2010 03:53 AM

Re: Random access to an encrypted file
 
Arne Vajhøj wrote:
> On 27-04-2010 04:15, Roedy Green wrote:
>> On Mon, 26 Apr 2010 10:41:36 -0500, Spud<fake@fkfkfkf.com> wrote,
>> quoted or indirectly quoted someone who said :
>>> We've been told that we need to implement on-disk encryption of our
>>> data files. We currently write them using RandomAccessFile and read
>>> them using FileChannel.read(ByteBuffer).
>>>
>>> Before I go off on my own, slog through java.security, and write a
>>> wrapper around these routines to encrypt/decrypt, is there an easy
>>> way to do it? Perhaps something built into the JDK that I'm missing?

>>
>> The easy way would be to find a database that does encryption.
>> see http://mindprod.com/jgloss/sqlvendors.html
>> for candidates.
>>
>> The awkward thing about roll your own is the growth factor that
>> encryption penalises you is not usually accurately predictable.

>
> I would expect every algorithm to have a very well defined
> function for the size after encryption depending on the
> size before encryption. 100% predictable.


I wouldn't. E.g an algortihm whose first step is to convert an array of
chars to an array of bytes encoded in UTF-8.




All times are GMT. The time now is 12:17 PM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57