[android-developers] Re: how and where to save SecretKey for encryption and decryption

2009-08-26 Thread Sujay Krishna Suresh
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 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 > pl

[android-developers] Re: how and where to save SecretKey for encryption and decryption

2009-08-26 Thread zeeshan
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 w

[android-developers] Re: how and where to save SecretKey for encryption and decryption

2009-08-26 Thread Sujay Krishna Suresh
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 wrote: > > encryption and decryption is the app's internal functionality. user > has nothing to do with this > i encrypt

[android-developers] Re: how and where to save SecretKey for encryption and decryption

2009-08-26 Thread zeeshan
key doesn't change. can i store keyString in preferences to retrieve for decryption SecretKey key = KeyGenerator.getInstance("DES").generateKey(); byte[] keybytes = key.getEncoded(); String keyString = new String(keybytes); or plz provide any example for the best practic

[android-developers] Re: how and where to save SecretKey for encryption and decryption

2009-08-26 Thread Sujay Krishna Suresh
On Wed, Aug 26, 2009 at 5:41 PM, zeeshan 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

[android-developers] Re: how and where to save SecretKey for encryption and decryption

2009-08-26 Thread zeeshan
key never change once its been created. as i know SecretKey generates by a funtion as above, how can i set it as constant can you plz provide example? On Aug 26, 1:39 pm, Sujay Krishna Suresh wrote: > On Wed, Aug 26, 2009 at 5:41 PM, zeeshan wrote: > > > key doesn't change. > > can i store key

[android-developers] Re: how and where to save SecretKey for encryption and decryption

2009-08-26 Thread Sujay Krishna Suresh
On Wed, Aug 26, 2009 at 7:16 PM, zeeshan wrote: > > key never change once its been created. > > as i know SecretKey generates by a funtion as above, how can i set it > as constant > can you plz provide example? > > > On Aug 26, 1:39 pm, Sujay Krishna Suresh > wrote: > > On Wed, Aug 26, 2009 at

[android-developers] Re: how and where to save SecretKey for encryption and decryption

2009-08-26 Thread sdphil
why can't you store it in a SharedPreferences ? On Aug 26, 7:33 am, Sujay Krishna Suresh wrote: > On Wed, Aug 26, 2009 at 7:16 PM, zeeshan wrote: > > > key never change once its been created. > > > as i know SecretKey generates by a funtion as above, how can i set it > > as constant > > can you

[android-developers] Re: how and where to save SecretKey for encryption and decryption

2009-08-26 Thread Haravikk
The more important question I think is why are you doing this, what information are you trying to protect? It seems like you're adding encryption for the sake of it, but in fact your solution won't be much more secure against someone determined to get at the file's contents. If the key is static,

[android-developers] Re: how and where to save SecretKey for encryption and decryption

2009-08-27 Thread zeeshan
i am just protecting some images (about 500) i downloaded on sdcard. on the first run it downloads and write each by CipherOutputStream and for the next time it decrypt those images by CipherInputStream. a static key works at the moment On Aug 26, 3:07 pm, Haravikk wrote: > The more important qu

[android-developers] Re: how and where to save SecretKey for encryption and decryption

2009-09-02 Thread gymshoe
Isn't java byte code remarkeably easy to reverse engineer into source code using one of many free java decompilers? >From my understanding, even using an obfuscator on the byte code (if that is possible with android implementation) isn't terrible effective at preventing decompilers from doing a g

[android-developers] Re: how and where to save SecretKey for encryption and decryption

2009-09-02 Thread Yusuf Saib (T-Mobile USA)
It just depends on how much the images are worth and how much the decryption costs the unauthorized party. If the images are not worth much (hypothetically speaking, of course), then decompiling the application isn't worth it. If on the other hand, the images will land you in jail (again, hypothet