Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > How and where to store a SecretKey

Reply
Thread Tools

How and where to store a SecretKey

 
 
David Segall
Guest
Posts: n/a
 
      01-26-2008
The typical tutorial on Java encryption such as
<http://java.sun.com/javase/6/docs/technotes/guides/security/crypto/CryptoSpec.html#SimpleEncrEx>
shows you how to generate a SecretKey and use it immediately to
encrypt and decrypt some text. I have not found any guidance on where
I might store the key or what format it is in. How can I store the key
in a database or in a property list?
 
Reply With Quote
 
 
 
 
Stefan Ram
Guest
Posts: n/a
 
      01-26-2008
David Segall <(E-Mail Removed)> writes:
>I might store the key or what format it is in


The key is not »in a format«.

It is an object.

An object is being defined by its behavior.

Some objects have a state that can be serialized
(written) and be deserialized (read) later.

If this applies, it should be possible to learn
more about it in the documentation of the class
of the object.

(Notwithstanding the question whether it is wise
to store a secret key in a database.)

 
Reply With Quote
 
 
 
 
Arne Vajhøj
Guest
Posts: n/a
 
      01-26-2008
David Segall wrote:
> The typical tutorial on Java encryption such as
> <http://java.sun.com/javase/6/docs/technotes/guides/security/crypto/CryptoSpec.html#SimpleEncrEx>
> shows you how to generate a SecretKey and use it immediately to
> encrypt and decrypt some text. I have not found any guidance on where
> I might store the key or what format it is in. How can I store the key
> in a database or in a property list?


SecretKey is serializable and can be stores as such.

But I think it is much more common to store the bytes used
to construct the SecretKey (SecretKeySpec).

Where to store it depends on the context.

Arne
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      01-27-2008
On Sat, 26 Jan 2008 16:52:48 GMT, David Segall <(E-Mail Removed)>
wrote, quoted or indirectly quoted someone who said :

>The typical tutorial on Java encryption such as
><http://java.sun.com/javase/6/docs/technotes/guides/security/crypto/CryptoSpec.html#SimpleEncrEx>
>shows you how to generate a SecretKey and use it immediately to
>encrypt and decrypt some text. I have not found any guidance on where
>I might store the key or what format it is in. How can I store the key
>in a database or in a property list?


A good place to put it would be a thumbdrive. That way it all trace
of it is gone from the computer, and unavailable to hackers.

see http://mindprod.com/bgloss/thumbdrive.html

A thumbdrive just looks like a tiny hard disk to Java.

--
Roedy Green, Canadian Mind Products
The Java Glossary, http://mindprod.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
storing SecretKey in keystore jimgardener Java 2 06-25-2008 01:30 PM
Properties file and save and store Ramza Brown Java 1 08-05-2005 09:01 PM
to store or not to store an image =?Utf-8?B?UnVkeQ==?= ASP .Net 6 03-30-2005 05:51 AM
how to retrieve and store an image in MS SQL and asp.net? angus ASP .Net 2 05-20-2004 02:40 PM



Advertisments