Last active
December 10, 2015 17:58
-
-
Save emboss/4470795 to your computer and use it in GitHub Desktop.
Revisions
-
emboss revised this gist
Jan 6, 2013 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,3 @@ import javax.crypto.Cipher; import javax.crypto.KeyGenerator; import javax.crypto.SecretKey; -
emboss created this gist
Jan 6, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ package testpolicyfiles; import javax.crypto.Cipher; import javax.crypto.KeyGenerator; import javax.crypto.SecretKey; public class TestPolicyFiles { public static void main(String[] args) { try { KeyGenerator keygen = KeyGenerator.getInstance("AES"); keygen.init(256); SecretKey key = keygen.generateKey(); Cipher aes = Cipher.getInstance("AES/CBC/PKCS5PAdding"); aes.init(Cipher.ENCRYPT_MODE, key); } catch (Exception ex) { throw new RuntimeException(ex); } } }