1. Download our Official Android App: Forums for Android!

Apps encryption help

Discussion in 'Android Development' started by triocorp, Jun 1, 2010.

  1. triocorp

    triocorp Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    1
    Joined:
    Jun 1, 2010

    Jun 1, 2010
    1
    0
    5
    Hi there,

    We have an application that runs under java and under android which encrypts and decrypts data using AES. We found that we can decrypt data under android if the data was originally encrypted using android, and same applies with the java version. However, if we tried decrypting under android data that was originally encrypted under java, it doesnt work, and vice versa.

    We believe we have narrowed it down to SecureRandom. For some reason, secret keys derived from SecureRandom are different for java and android.

    Has anyone else experienced this and are there any solutions to this problem?

    Thanks in advance.
     

    Advertisement

  2. TheAndroidWorks

    TheAndroidWorks Android Enthusiast
    Rank:
    None
    Points:
    43
    Posts:
    269
    Joined:
    Dec 17, 2009

    Dec 17, 2009
    269
    27
    43
    Android Developer
    Nashville
    Yes, we encountered a small stump when we wrote our 256 AES Android to PHP interop a while back. I can't remember exactly what the solution was, but I will ask the other developer... for some reason I think I remember it having to do with bytecode formats.

    PHP and Android/Java had two very different ways of handling the encrypted strings that caused problems within the encrypt and decrypt functions that we had to program around.

    I know it may be stating the obvious, but have you tested for snags in passing the key and IV, etc?
     
  3. gtx

    gtx Lurker
    Rank:
    None
    Points:
    5
    Posts:
    1
    Joined:
    Jan 18, 2011

    Jan 18, 2011
    1
    0
    5
    Hi,
    Did you end up solving this problem? Can you post a link to the solution?
     

Share This Page

Loading...