Skip to content

Instantly share code, notes, and snippets.

View bekwam's full-sized avatar

Bekwam, Inc bekwam

View GitHub Profile
@armanso
armanso / AES.java
Last active August 7, 2023 02:34
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;