/** Creates a new instance of StandardDecryption */ public StandardDecryption(byte key[], int off, int len, int revision) { aes = revision == AES_128; if (aes) { this.key = new byte[len]; System.arraycopy(key, off, this.key, 0, len); } else { arcfour = new ARCFOUREncryption(); arcfour.prepareARCFOURKey(key, off, len); } }
/** Creates a new instance of StandardDecryption */ public StandardDecryption(byte[] key, int off, int len, int revision) { aes = revision == AES_128; if (aes) { this.key = new byte[len]; System.arraycopy(key, off, this.key, 0, len); } else { arcfour = new ARCFOUREncryption(); arcfour.prepareARCFOURKey(key, off, len); } }
/** Creates a new instance of StandardDecryption */ public StandardDecryption(byte key[], int off, int len, int revision) { aes = revision == AES_128; if (aes) { this.key = new byte[len]; System.arraycopy(key, off, this.key, 0, len); } else { arcfour = new ARCFOUREncryption(); arcfour.prepareARCFOURKey(key, off, len); } }
/** Creates a new instance of OutputStreamCounter */ public OutputStreamEncryption(OutputStream out, byte[] key, int off, int len, int revision) { try { this.out = out; aes = revision == AES_128; if (aes) { byte[] iv = IVGenerator.getIV(); byte[] nkey = new byte[len]; System.arraycopy(key, off, nkey, 0, len); cipher = new AESCipher(true, nkey, iv); write(iv); } else { arcfour = new ARCFOUREncryption(); arcfour.prepareARCFOURKey(key, off, len); } } catch (Exception ex) { throw new ExceptionConverter(ex); } }
/** Creates a new instance of OutputStreamCounter */ public OutputStreamEncryption(OutputStream out, byte key[], int off, int len, int revision) { try { this.out = out; aes = revision == AES_128; if (aes) { byte[] iv = IVGenerator.getIV(); byte[] nkey = new byte[len]; System.arraycopy(key, off, nkey, 0, len); cipher = new AESCipher(true, nkey, iv); write(iv); } else { arcfour = new ARCFOUREncryption(); arcfour.prepareARCFOURKey(key, off, len); } } catch (Exception ex) { throw new ExceptionConverter(ex); } }
/** Creates a new instance of OutputStreamCounter */ public OutputStreamEncryption(OutputStream out, byte key[], int off, int len, int revision) { try { this.out = out; aes = revision == AES_128; if (aes) { byte[] iv = IVGenerator.getIV(); byte[] nkey = new byte[len]; System.arraycopy(key, off, nkey, 0, len); cipher = new AESCipher(true, nkey, iv); write(iv); } else { arcfour = new ARCFOUREncryption(); arcfour.prepareARCFOURKey(key, off, len); } } catch (Exception ex) { throw new ExceptionConverter(ex); } }