So my problem is this: i have a password that i'm encrypting in Laravel 5.6 with AES-256-CBC and send it to an android device, problem is i can't find a way to decrypt it knowing that i found a way to extract the IV and the encrypted value and the key is available on the android device ! 

I'm successfully decrypting the value if i use AES-128-CBC using this code on the android device, but failing the AES-256-CBC cypher and i don't understand where the problem is ! 
The code : 

```
public static String decrypt(byte[] keyValue, String ivValue, String encryptedData) throws Exception {
    Key key = new SecretKeySpec(keyValue, "AES");
    byte[] iv = Base64.decode(ivValue.getBytes("UTF-8"), Base64.DEFAULT);
    byte[] decodedValue = Base64.decode(encryptedData.getBytes("UTF-8"), Base64.DEFAULT);
    Cipher c = Cipher.getInstance("AES/CBC/PKCS7Padding");
    c.init(Cipher.DECRYPT_MODE, key, new IvParameterSpec(iv));
    byte[] decValue = c.doFinal(decodedValue);

   return new String(decValue);
}

```

At what instance it's specified that this code should use AES-128 and not 256 ? and how can i change it ! 

Thanks in advance ! 

---

**EDIT**

the PHP code is as follows : 

```
$cipher="AES-256-CBC";
$key='somerandomkeyof32byteslong';
$crypt=new Encrypter($key,$cipher);
$result=$crypt->encryptString('oussama');
//i'm sending the result to the android device

```