Skip to content

Latest commit

 

History

History
12 lines (10 loc) · 366 Bytes

File metadata and controls

12 lines (10 loc) · 366 Bytes

Decrypt Using AES

using javax.crypto package decrypt the cipherText.

byte[] decryptByKey(String data, byte[] key) {
    Cpiher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
    byte[] decoded = Base64.getDecodr().decode(data);
    cipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(key, "AES"));
    byte[] plain = cipher.doFinal(decoded);
}