List of usage examples for org.apache.commons.math.random RandomDataImpl setSecureAlgorithm
public void setSecureAlgorithm(String algorithm, String provider) throws NoSuchAlgorithmException, NoSuchProviderException
From source file:org.qnot.passtab.TabulaRecta.java
public void generate() { RandomDataImpl rand = new RandomDataImpl(); try {//from w w w. jav a 2 s .c om rand.setSecureAlgorithm("SHA1PRNG", "SUN"); } catch (NoSuchProviderException e) { throw new RuntimeException("Failed to set secure provider", e); } catch (NoSuchAlgorithmException e) { throw new RuntimeException("Failed to set secure algorithm", e); } for (int i = 0; i < this.headerAlphabet.size(); i++) { tabulaRecta[i] = generateRow(i, rand); } }