Encrypt with Android using AES, decrypt with PHP...

by Raymond C. Rodgers » Mon, 19 Jul 2010 20:45:58 GMT


Sponsored Links
 There is slightly. You need to null pad the data being encrypted to make 
sure it's evenly divisible by 16 on Android. PHP does it automatically 
and silently. See my posts in this thread:





Encrypt with Android using AES, decrypt with PHP...

by Raymond C. Rodgers » Tue, 20 Jul 2010 00:26:21 GMT


 Well, I'm not talking security wise, just compatibility wise, nor did I 
say that this was Android specific. However, what I did say was that you 
do have to do this in order to get PHP-Android encryption working. 
Android to PHP encryption with AES will not "just work" without adding 
the null padding or some other mutually recognized padding, so I'd say 
that yes this is slightly special as I stated before.




That's not something special. That's actually what the algorithms are specified to require, and the APIs reflect that. They're not even Android-specific APIs, they're Java APIs, and the algorithms are standards and not tied to language or platform. Ideally, you'd pad with random bytes, instead of null bytes, which probably weaken the encryption significantly -- any time an attacker knows part of the message, it makes his job simpler. So I'd say PHP's behavior is a special case, and even a design flaw (both a convenience AND a design flaw, viewed from the standpoint of conflicting requirements). On Jul 19, 5:45 am, "Raymond C. Rodgers"<raym...@badlucksoft.com>
There is slightly. You need to null pad the data being encrypted to make sure it's evenly divisible by 16 on Android. PHP does it automatically and silently. See my posts in this thread:


Sponsored Links


Other Threads

1. Mediastore get image from thumbnails

Hello people,

I am having a problem regarding mediastore.media.Images. I am trying
to populate a gallery with thumbnails from y sdcard, this works fine,
now i want to get the real image in an imageview onclick event.

Here is my code ,

private View loadGallery() {
        // thumbnails
        String[] proj = { MediaStore.Images.Thumbnails._ID };

        cursor = managedQuery(
                MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI,
proj, // Which
                                                                            //
columns
                                                                            //
to
                                                                            //
return
                null, // WHERE clause; which rows to return (all rows)
                null, // WHERE clause selection arguments (none)
                MediaStore.Images.Thumbnails.IMAGE_ID + " DESC"); //
Order-by clause
                                                        // (ascending
by IMAGE ID  descending order)

        column_index = cursor
                .getColumnIndexOrThrow
(MediaStore.Images.Thumbnails._ID);
        // Reference the Gallery view
        // g = (Gallery) findViewById(R.id.galleryImg);
        g = new Gallery(this);
        // Set the adapter to our custom adapter (below)
        g.setAdapter(new ImageAdapter(this));

        // Set a item click listener, and just Toast the clicked
position
        g.setOnItemClickListener(new OnItemClickListener() {
            public void onItemClick(AdapterView<?> parent, View v,
                    int position, long id) {
                // Preview Image i can get the position on the image
Gallery
// how do i get the imagepath, or absolute path of the real image from
the thumnail?

            }
        });
        return g;
    }

Many Thanks
--~--~---------~--~----~------------~-------~--~----~

2. Can't not run MapView on my Target board.

Hi All

I really want to run MapView on my target board.
I'm able to run goole map Application on Emulator with proper API key.
On my target board, I can run excute but it was locked.
I really want to know why It was locked.

Something else need to be done for it ?

Help me, please.

--~--~---------~--~----~------------~-------~--~----~

3. Manifest android:label

4. Custom build problems

5. hasMonetaryCost = true for "network" location provider

6. getting time, 5 minutes into future, past 55 minutes in the hour near midnight with TimePicker dialog

7. Are apps able to make money in Android Marketplace? (or, what is the business case?)