Android AES Encrypt encrypt(byte[] key, byte[] src)

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

Description

encrypt

Declaration

private static byte[] encrypt(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[] encrypt(byte[] key, byte[] src) throws Exception {
        SecretKeySpec skeySpec = new SecretKeySpec(key, "AES");
        Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
        cipher.init(Cipher.ENCRYPT_MODE, skeySpec);
        return cipher.doFinal(src);
    }//from   w  w  w  . j a va2 s.  co  m
}

Related

  1. encrypt(byte[] content, String password)
  2. encrypt(byte[] data, Key key)
  3. encrypt(byte[] data, Key key, String cipherAlgorithm)
  4. encrypt(byte[] data, byte[] key)
  5. encrypt(byte[] data, byte[] key, String cipherAlgorithm)
  6. encrypt(byte[] key, byte[] src)
  7. encrypt(byte[] raw, byte[] clear)
  8. encrypt(byte[] raw, byte[] clear)
  9. encrypt(byte[] raw, byte[] clear)