Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Security / November 2006

Tip: Looking for answers? Try searching our database.

generating AES 128 bit key frm password

Thread view: 
Rajesh - 08 Nov 2006 05:32 GMT
Hello All,
I want to create 128 bits AES key from (user's password + unique salt
to that user) , key will be used to encrypt his private key in my
database. plz suggest ways for it using JDK 1.5 and SUN JCE provider
only.

My sol'n. is:

step 1> seed SHA1PRNG with (user's password + unique salt to that user)

step 2> initialize keyGenerator with this PRNG
step 3> just call 'GenerateKey()' method once. to get 'same' key all
the time.

I think, there must be smoother way than this.
I tried 'SecretKeyFactory' with PBEKeySpec, but it doesn't generate
"AES" keys

Your suggestions are most welcome. :-)
Mike Amling - 10 Nov 2006 03:27 GMT
Majestic wrote:
> Hello All,
> I want to create 128 bits AES key from (user's password + unique salt
[quoted text clipped - 11 lines]
>
> I think, there must be smoother way than this.

  You can use the first 128 bits of the SHA-1 hash of the password-salt
concatenation.

--Mike Amling
Rajesh - 10 Nov 2006 05:30 GMT
> Majestic wrote:
> > Hello All,
[quoted text clipped - 17 lines]
>
> --Mike Amling

then, how to generate 'SecretKey' frm those raw key bytes,
SecretKeyFactory doesn't help.
plz give code snippets :-)

thnx in advance.
Mike Amling - 12 Nov 2006 17:53 GMT
>> Majestic wrote:
>>> I think, there must be smoother way than this.
[quoted text clipped - 7 lines]
> SecretKeyFactory doesn't help.
> plz give code snippets :-)

  Sorry, I've never used anything in javax.crypto or the JCE.

  Anyone?

--Mike Amling


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.