@Test public void testEncryptLongArrayAes258Twofish256UnlimitedStrength() throws Exception { testEncrypt( TestFileUtil.createRandomArray(1024*1024), Arrays.asList(new CipherSpec[] { CipherSpecs.getCipherSpec(CipherSpecs.AES_256_GCM), CipherSpecs.getCipherSpec(CipherSpecs.TWOFISH_256_GCM) }) ); }
public static byte[] createRandomArray(int size) { byte[] randomByteArray = new byte[size]; secureRandom.nextBytes(randomByteArray); return randomByteArray; }
CipherUtil { public static byte[] createRandomArray(int size) { byte[] randomByteArray = new byte[size]; secureRandom.nextBytes(randomByteArray); return randomByteArray; } }
CipherUtil { public static byte[] createRandomArray(int size) { byte[] randomByteArray = new byte[size]; secureRandom.nextBytes(randomByteArray); return randomByteArray; }  }
CipherUtil { public static byte[] createRandomArray(int size) { byte[] randomByteArray = new byte[size]; secureRandom.nextBytes(randomByteArray); return randomByteArray; }  static synchronized void init(); static void enableUnlimitedStrength(); static byte[] createRandomArray(int size); static String createRandomAlphabeticString(int size); static SaltedSecretKey createDerivedKey(SecretKey inputKey, byte[] inputSalt, CipherSpec outputCipherSpec); static SaltedSecretKey createDerivedKey(byte[] inputKeyMaterial, byte[] inputSalt, String outputKeyAlgorithm, int outputKeySize); static SecretKey toSecretKey(byte[] secretKeyBytes, String algorithm); static SaltedSecretKey toSaltedSecretKey(byte[] secretKeyBytes, byte[] saltBytes, String algorithm); static SaltedSecretKey createMasterKey(String password); static SaltedSecretKey createMasterKey(String password, byte[] salt); static boolean isEncrypted(File file); static void encrypt(InputStream plaintextInputStream, OutputStream ciphertextOutputStream, List<CipherSpec> cipherSpecs,
			SaltedSecretKey masterKey); static byte[] encrypt(InputStream plaintextInputStream, List<CipherSpec> cipherSuites, SaltedSecretKey masterKey); static byte[] decrypt(InputStream fromInputStream, SaltedSecretKey masterKey); static KeyPair generateRsaKeyPair(); static X509Certificate generateSelfSignedCertificate(String commonName, KeyPair keyPair); static SSLContext createSSLContext(KeyStore keyStore, KeyStore trustStore); }
CipherUtil { public static byte[] createRandomArray(int size) { byte[] randomByteArray = new byte[size]; secureRandom.nextBytes(randomByteArray); return randomByteArray; }  static synchronized void init(); static void enableUnlimitedStrength(); static byte[] createRandomArray(int size); static String createRandomAlphabeticString(int size); static SaltedSecretKey createDerivedKey(SecretKey inputKey, byte[] inputSalt, CipherSpec outputCipherSpec); static SaltedSecretKey createDerivedKey(byte[] inputKeyMaterial, byte[] inputSalt, String outputKeyAlgorithm, int outputKeySize); static SecretKey toSecretKey(byte[] secretKeyBytes, String algorithm); static SaltedSecretKey toSaltedSecretKey(byte[] secretKeyBytes, byte[] saltBytes, String algorithm); static SaltedSecretKey createMasterKey(String password); static SaltedSecretKey createMasterKey(String password, byte[] salt); static boolean isEncrypted(File file); static void encrypt(InputStream plaintextInputStream, OutputStream ciphertextOutputStream, List<CipherSpec> cipherSpecs,
			SaltedSecretKey masterKey); static byte[] encrypt(InputStream plaintextInputStream, List<CipherSpec> cipherSuites, SaltedSecretKey masterKey); static byte[] decrypt(InputStream fromInputStream, SaltedSecretKey masterKey); static KeyPair generateRsaKeyPair(); static X509Certificate generateSelfSignedCertificate(String commonName, KeyPair keyPair); static SSLContext createSSLContext(KeyStore keyStore, KeyStore trustStore);  }