Android Question AES problem

Discussion in 'Android Questions' started by omidaghakhani1368, Jun 25, 2015.

  1. omidaghakhani1368

    omidaghakhani1368 Well-Known Member Licensed User

    Hi
    I use below code for encrypt data with aes
    Code:
    Dim b64 As Base64
    Dim kg As KeyGenerator
    kg.Initialize(
    "AES")
    Dim md As MessageDigest
    Dim p As String
    p = 
    "pas#$@#$DASdasd"
    kg.KeyFromBytes(md.GetMessageDigest(p.GetBytes(
    "UTF8"), "MD5"))
    Dim c As Cipher
    c.Initialize(
    "AES")
    Dim data() As Byte
    data = c.Encrypt(
    "dennis".GetBytes("UTF8"), kg.Key, False)
    Log( b64.EncodeBtoS(data, 0, data.Length))
    but output is different is below address.
    http://aesencryption.net/
    I want to use output in php.
    In php that not working.
    How solve it?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    I don't see that they are using MD5 to create the key in the php example.
     
  3. omidaghakhani1368

    omidaghakhani1368 Well-Known Member Licensed User

    Thanks.I cannot decrypt string php.Have you php example?thank you erel
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    No.
    If you can switch to B4J instead of PHP then you can use B4XEncryption which is cross platform (B4A, B4J and B4i).
     
  5. omidaghakhani1368

    omidaghakhani1368 Well-Known Member Licensed User

    Thank you
     
Loading...