Skip to content

Instantly share code, notes, and snippets.

View ddold's full-sized avatar
🏠
Working from home

Dan ddold

🏠
Working from home
  • CloudBees
  • Ireland
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;