@Override BlockCipher createBlockCipher(byte[] key, byte[] iv, boolean encrypt) { return BlockCipherFactory.createCipher("aes128-cbc", encrypt, key, iv); } },
/** * Unless you know what you are doing, you will never need this. * * @return The list of supported cipher algorithms by this implementation. */ public static synchronized String[] getAvailableCiphers() { return BlockCipherFactory.getDefaultCipherList(); }
public static void checkCipherList(String[] cipherCandidates) { for (int i = 0; i < cipherCandidates.length; i++) getEntry(cipherCandidates[i]); }
private boolean establishKeyMaterial() { try { int mac_cs_key_len = MAC.getKeyLen(kxs.np.mac_algo_client_to_server); int enc_cs_key_len = BlockCipherFactory.getKeySize(kxs.np.enc_algo_client_to_server); int enc_cs_block_len = BlockCipherFactory.getBlockSize(kxs.np.enc_algo_client_to_server); int mac_sc_key_len = MAC.getKeyLen(kxs.np.mac_algo_server_to_client); int enc_sc_key_len = BlockCipherFactory.getKeySize(kxs.np.enc_algo_server_to_client); int enc_sc_block_len = BlockCipherFactory.getBlockSize(kxs.np.enc_algo_server_to_client); km = KeyMaterial.create("SHA1", kxs.H, kxs.K, sessionId, enc_cs_key_len, enc_cs_block_len, mac_cs_key_len, enc_sc_key_len, enc_sc_block_len, mac_sc_key_len); } catch (IllegalArgumentException e) { return false; } return true; }
/** * Unless you know what you are doing, you will never need this. * * @param ciphers ciphers */ public synchronized void setClient2ServerCiphers(String[] ciphers) { if ((ciphers == null) || (ciphers.length == 0)) throw new IllegalArgumentException(); ciphers = removeDuplicates(ciphers); BlockCipherFactory.checkCipherList(ciphers); cryptoWishList.c2s_enc_algos = ciphers; }
private boolean establishKeyMaterial() { try { int mac_cs_key_len = MAC.getKeyLen(kxs.np.mac_algo_client_to_server); int enc_cs_key_len = BlockCipherFactory.getKeySize(kxs.np.enc_algo_client_to_server); int enc_cs_block_len = BlockCipherFactory.getBlockSize(kxs.np.enc_algo_client_to_server); int mac_sc_key_len = MAC.getKeyLen(kxs.np.mac_algo_server_to_client); int enc_sc_key_len = BlockCipherFactory.getKeySize(kxs.np.enc_algo_server_to_client); int enc_sc_block_len = BlockCipherFactory.getBlockSize(kxs.np.enc_algo_server_to_client); km = KeyMaterial.create("SHA1", kxs.H, kxs.K, sessionId, enc_cs_key_len, enc_cs_block_len, mac_cs_key_len, enc_sc_key_len, enc_sc_block_len, mac_sc_key_len); } catch (IllegalArgumentException e) { return false; } return true; }
/** * Unless you know what you are doing, you will never need this. * * @param ciphers */ public synchronized void setClient2ServerCiphers(String[] ciphers) { if ((ciphers == null) || (ciphers.length == 0)) throw new IllegalArgumentException(); ciphers = removeDuplicates(ciphers); BlockCipherFactory.checkCipherList(ciphers); cryptoWishList.c2s_enc_algos = ciphers; }
public static int getBlockSize(String type) { CipherEntry ce = getEntry(type); return ce.blocksize; }
private boolean establishKeyMaterial() { try { int mac_cs_key_len = MessageMac.getKeyLength(kxs.np.mac_algo_client_to_server); int enc_cs_key_len = BlockCipherFactory.getKeySize(kxs.np.enc_algo_client_to_server); int enc_cs_block_len = BlockCipherFactory.getBlockSize(kxs.np.enc_algo_client_to_server); int mac_sc_key_len = MessageMac.getKeyLength(kxs.np.mac_algo_server_to_client); int enc_sc_key_len = BlockCipherFactory.getKeySize(kxs.np.enc_algo_server_to_client); int enc_sc_block_len = BlockCipherFactory.getBlockSize(kxs.np.enc_algo_server_to_client); km = KeyMaterial.create(kxs.getHashAlgorithm(), kxs.H, kxs.K, sessionId, enc_cs_key_len, enc_cs_block_len, mac_cs_key_len, enc_sc_key_len, enc_sc_block_len, mac_sc_key_len); } catch (IllegalArgumentException e) { return false; } return true; }
@Override BlockCipher createBlockCipher(byte[] key, byte[] iv, boolean encrypt) { return BlockCipherFactory.createCipher("aes192-cbc", encrypt, key, iv); } },
/** * Unless you know what you are doing, you will never need this. * * @param ciphers */ public synchronized void setServer2ClientCiphers(String[] ciphers) { if ((ciphers == null) || (ciphers.length == 0)) throw new IllegalArgumentException(); ciphers = removeDuplicates(ciphers); BlockCipherFactory.checkCipherList(ciphers); cryptoWishList.s2c_enc_algos = ciphers; }
/** * Unless you know what you are doing, you will never need this. * * @return The list of supported cipher algorithms by this implementation. */ public static synchronized String[] getAvailableCiphers() { return BlockCipherFactory.getDefaultCipherList(); }
public static int getKeySize(String type) { CipherEntry ce = getEntry(type); return ce.keysize; } }
@Override BlockCipher createBlockCipher(byte[] key, byte[] iv, boolean encrypt) { return BlockCipherFactory.createCipher("3des-cbc", encrypt, key, iv); } },
/** * Unless you know what you are doing, you will never need this. * * @param ciphers */ public synchronized void setClient2ServerCiphers(String[] ciphers) { if ((ciphers == null) || (ciphers.length == 0)) throw new IllegalArgumentException(); ciphers = removeDuplicates(ciphers); BlockCipherFactory.checkCipherList(ciphers); cryptoWishList.c2s_enc_algos = ciphers; }
/** * Unless you know what you are doing, you will never need this. * * @return The list of supported cipher algorithms by this implementation. */ public static synchronized String[] getAvailableCiphers() { return BlockCipherFactory.getDefaultCipherList(); }
public static int getBlockSize(String type) { CipherEntry ce = getEntry(type); return ce.blocksize; }
@Override BlockCipher createBlockCipher(byte[] key, byte[] iv, boolean encrypt) { return BlockCipherFactory.createCipher("aes256-ctr", encrypt, key, iv); } };
/** * Unless you know what you are doing, you will never need this. * * @param ciphers */ public synchronized void setServer2ClientCiphers(String[] ciphers) { if ((ciphers == null) || (ciphers.length == 0)) throw new IllegalArgumentException(); ciphers = removeDuplicates(ciphers); BlockCipherFactory.checkCipherList(ciphers); cryptoWishList.s2c_enc_algos = ciphers; }
public static void checkCipherList(String[] cipherCandidates) { for (int i = 0; i < cipherCandidates.length; i++) getEntry(cipherCandidates[i]); }