Skip to content

Instantly share code, notes, and snippets.

View avandeursen's full-sized avatar

Arie van Deursen avandeursen

View GitHub Profile
@twuni
twuni / CryptoHelper.java
Last active February 18, 2022 19:09
A basic example of how to perform symmetric key encryption/decryption using AES and Java's cryptography API.
import java.security.Key;
import java.security.SecureRandom;
import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
import javax.crypto.spec.IvParameterSpec;
import org.apache.commons.codec.binary.Base64;