Android AES Decrypt decrypt(byte[] raw, byte[] encrypted)

Here you can find the source of decrypt(byte[] raw, byte[] encrypted)

Description

decrypt

Declaration

private static byte[] decrypt(byte[] raw, byte[] encrypted)
            throws Exception 

Method Source Code

//package com.java2s;

import javax.crypto.Cipher;

import javax.crypto.spec.SecretKeySpec;

public class Main {
    private static byte[] decrypt(byte[] raw, byte[] encrypted)
            throws Exception {
        SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
        Cipher cipher = Cipher.getInstance("AES");
        cipher.init(Cipher.DECRYPT_MODE, skeySpec);
        byte[] decrypted = cipher.doFinal(encrypted);
        return decrypted;
    }/*from w  w w .j  av  a2s. c o  m*/
}

Related

  1. aesDecode(String seed, String encrypted)
  2. decrypt(byte[] raw, byte[] encrypted)
  3. decrypt(Context context, String encrypted)
  4. decrypt(Context context, String encrypted)
  5. decode(String seed, String encrypted)
  6. decryptedData(String userkey, String encryptedData)
  7. decryptedPassword(String key, String encryptedData)