On Wed, Aug 26, 2009 at 5:41 PM, zeeshan <[email protected]> wrote:
>
> key doesn't change.
> can i store keyString in preferences to retrieve for decryption
yes that'd be better than storin it in a file. But better to jus have a
constant field in ur class that cointains ur key.
>
>
> SecretKey key = KeyGenerator.getInstance("DES").generateKey();
> byte[] keybytes = key.getEncoded();
> String keyString = new String(keybytes);
If u r gonna execute these set of statements then wont the key change??
>
>
> or plz provide any example for the best practice
>
> On Aug 26, 12:28 pm, Sujay Krishna Suresh <[email protected]>
> wrote:
> > If it is only used by ur application, jus use a String instance to hold
> the
> > key. y store in a file??
> > ll the key change dynamically???
> >
> >
> >
> > On Wed, Aug 26, 2009 at 4:55 PM, zeeshan <[email protected]> wrote:
> >
> > > encryption and decryption is the app's internal functionality. user
> > > has nothing to do with this
> > > i encrypt the file on 1st run and on 2nd run i check if file is there
> > > then decrypt and show.
> > > so only thing i understand is to store the key somewhere in the app so
> > > i can access it for decryption.
> > > just wondering if this help
> > > File keyFile = new File("data/data/package name/key");
> >
> > > i followed this link for encryption and decryption
> >
> > >http://www.java2s.com/Tutorial/Java/0490__Security/UsingCipherInputSt.
> ..
> >
> > > On Aug 26, 12:11 pm, Sujay Krishna Suresh <[email protected]>
> > > wrote:
> > > > I think its better to ask the user for the secret key rather than
> storin
> > > it
> > > > smwhere.
> >
> > > > On Wed, Aug 26, 2009 at 4:30 PM, zeeshan <[email protected]> wrote:
> >
> > > > > Hi Dear,
> >
> > > > > i wrote a small application which encrypt some files using a secret
> > > > > key.
> > > > > i need to decrypt files on 2nd run which requires same key again
> > > > > plz advise where should i store the secret key.
> >
> > > > --
> > > > Regards,
> > > > Sujay
> > > > Mike Ditka <
> http://www.brainyquote.com/quotes/authors/m/mike_ditka.html>
> > > -
> > > > "If God had wanted man to play soccer, he wouldn't have given us
> arms."
> >
> > --
> > Regards,
> > Sujay
> > Pablo Picasso<
> http://www.brainyquote.com/quotes/authors/p/pablo_picasso.html>
> > - "Computers are useless. They can only give you answers."
> >
>
--
Regards,
Sujay
Jonathan Swift<http://www.brainyquote.com/quotes/authors/j/jonathan_swift.html>
- "May you live every day of your life."
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---