Skip to content

Instantly share code, notes, and snippets.

@akwizgran
akwizgran / PseudoSecureRandom.java
Created March 31, 2017 10:21
Deterministic SecureRandom (neither secure nor random)
import java.security.Provider;
import java.security.SecureRandom;
import java.security.SecureRandomSpi;
import org.bouncycastle.crypto.digests.SHA256Digest;
import org.bouncycastle.crypto.engines.Salsa20Engine;
import org.bouncycastle.crypto.params.KeyParameter;
import org.bouncycastle.crypto.params.ParametersWithIV;
public class PseudoSecureRandom extends SecureRandom {