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. problems with Gallery and gestures

Hi all,
I am using a Gallery view.  This is my goal:  I would like to be able
to listen for gestures so that I can take specifc action, in addition
to allowing the "usual" action that the Android framework provides.
For instance, when the user scrolls the Gallery, I would like to know
that the user has moved away from the currently selected item to go to
a new item, but I also don't want to interfere with the Gallery
scrolling action (Gallery.onScroll()).

If instead of a Gallery view, I had a LinearLayout, this would be
easy, as my Activity could implement OnGestureListener, I could
instantiate a GestureDetector variable which is "fed" to onTouch(),
and then override the onScroll() method.
(see 

2. Android Marketplace - No App Icon or Images?

I don't see a place to upload an app icon or photos.
Is there now way for users to see screens of your app before they buy
it?


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

3. Understanding animation repeat

4. Android Developer Console and the Market - Several Issues

5. some questions about AP-"Pictures"

6. local classes and starting new activity

7. what's the "Media Button"?