Skip to content

Instantly share code, notes, and snippets.

View thackerronak's full-sized avatar

Ronak Thacker (smartSense) thackerronak

  • smartSense solutions
  • Ahmedabad
View GitHub Profile
@thackerronak
thackerronak / AESHelper.java
Last active September 5, 2024 16:35 — forked from armanso/AES.java
AES encryption/decryption in crypto-js way, use KDF for generating IV and Key, use CBC with PKCS7Padding for Cipher
import com.sun.jersey.core.util.Base64;
import java.io.UnsupportedEncodingException;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.util.Arrays;
import java.util.Random;
import javax.crypto.BadPaddingException;