Android AES Decrypt decrypt(byte[] key, byte[] src)

Here you can find the source of decrypt(byte[] key, byte[] src)

Description

decrypt

Declaration

private static byte[] decrypt(byte[] key, byte[] src) 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[] key, byte[] src) throws Exception {
        SecretKeySpec skeySpec = new SecretKeySpec(key, "AES");
        Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
        cipher.init(Cipher.DECRYPT_MODE, skeySpec);
        return cipher.doFinal(src);
    }// ww  w  .j a  v a 2  s . c  o m
}

Related

  1. decrypt(byte[] data, Key key, String cipherAlgorithm)
  2. decrypt(byte[] data, byte[] key)
  3. decrypt(byte[] data, byte[] key, String cipherAlgorithm)
  4. decrypt(byte[] encryptSource)
  5. decrypt(byte[] key, byte[] encrypted)
  6. decrypt(byte[] raw, byte[] encrypted)
  7. decrypt(byte[] raw, byte[] encrypted)
  8. decrypt(byte[] raw, byte[] encrypted)
  9. decrypt(byte[] raw, byte[] encrypted)