Encrypting your data
Sometimes you don't want to store any data on the sd card, but you have to, because your apps resources would take up too much space int the internal memory.
Here is a method on how to store your data securely.
Java has very easy to use built in encrypting methods, but they take up precious time.
For example a 188Kb jpg on a Nexus one would take:
Encode: 750ms
Decode 550ms
So I don't recommend using encryption on large files,
- KeyGenerator keyGenerator = KeyGenerator.getInstance("AES");
- keyGenerator.init(192);
- return keyGenerator.generateKey().getEncoded();
- }
You need to store the key in your app.
- public byte[] encript(byte[] dataToEncrypt, byte[] key)
- throws NoSuchAlgorithmException, NoSuchPaddingException,
- InvalidKeyException, IllegalBlockSizeException, BadPaddingException {
- //I'm using AES encription
- Cipher c = Cipher.getInstance("AES");
- SecretKeySpec k = new SecretKeySpec(key, "AES");
- c.init(Cipher.ENCRYPT_MODE, k);
- return c.doFinal(dataToEncrypt);
- }
- public byte[] decript(byte[] encryptedData, byte[] key)
- throws NoSuchAlgorithmException, NoSuchPaddingException,
- InvalidKeyException, IllegalBlockSizeException, BadPaddingException {
- Cipher c = Cipher.getInstance("AES");
- SecretKeySpec k = new SecretKeySpec(key, "AES");
- c.init(Cipher.DECRYPT_MODE, k);
- return c.doFinal(encryptedData);
- }
New tutorials from Helloandroid
Recent Apps
Android on Twitter
-
@Idevicegazette (iDevice Gazette)
GSM-to-Skype bridge lets you lose those roaming fees http://bit.ly/lbRJeh #android
11 years 37 weeks ago -
@tommy_banane (tom b.)
RT @AndroidFavorite: #Android New Desktop Android Market Is Live, Adds Several New Features http://zorr0.nl/lFwXNz
11 years 37 weeks ago -
@dwilliams5 (Dennis Williams)
just completed a runtastic run of 3.02 km in 40 min 11 s with #runtastic #Android App: http://tinyurl.com/5tvrpe3
11 years 37 weeks ago -
@S_Pinz (Spinz!)
RT @Androidheadline: Out of box #LG Optimus 3D got Quadrant 2420 score. Thanks @blink_c #io2011 #android http://twitpic.com/4whkdz
11 years 38 weeks ago -
@tayaitapps (Taya IT)
Next Google TV Looks A Lot Like Android http://t.co/dvlTim3 via @alleyinsider #google #apple #android #tv #honeycomb
11 years 38 weeks ago
Poll
Useful resources
Android Development Projects
- iOS/Android Developer to take older Games and bring them Current
- Android apps developer - need to finish urgent.
- Buliding MobileApp For onlie order
- looking for android APP developers
- Create an ecommerce app
- text-to voice for smartphones IOS - GOOGLE - HARMONY - AND ALEXA
- Optimize Images on App
- Create small feature with drag-drop text for Android
- Scouting for advanced website and Mobile apps developers. Potential Long-term contract.
- BLACK SCREEN