<li><ahref="../../../../../net/ME1312/SubServers/Host/Network/AES.InvalidAESStreamException.html"title="class in net.ME1312.SubServers.Host.Network"><spanclass="typeNameLink">Next Class</span></a></li>
<divclass="block">A class to perform password-based AES encryption and decryption in CBC mode.
128, 192, and 256-bit encryption are supported, provided that the latter two
are permitted by the Java runtime's jurisdiction policy files.
<br/>
The public interface for this class consists of the static methods
<ahref="../../../../../net/ME1312/SubServers/Host/Network/AES.html#encrypt-int-java.lang.String-java.io.InputStream-java.io.OutputStream-"><code>encrypt(int, java.lang.String, java.io.InputStream, java.io.OutputStream)</code></a> and <ahref="../../../../../net/ME1312/SubServers/Host/Network/AES.html#decrypt-java.lang.String-java.io.InputStream-java.io.OutputStream-"><code>decrypt(java.lang.String, java.io.InputStream, java.io.OutputStream)</code></a>, which encrypt and decrypt arbitrary
<tdclass="colLast"><code><spanclass="memberNameLink"><ahref="../../../../../net/ME1312/SubServers/Host/Network/AES.InvalidAESStreamException.html"title="class in net.ME1312.SubServers.Host.Network">AES.InvalidAESStreamException</a></span></code>
<divclass="block">Thrown if an attempt is made to decrypt an invalid AES stream.</div>
<tdclass="colLast"><code><spanclass="memberNameLink"><ahref="../../../../../net/ME1312/SubServers/Host/Network/AES.InvalidKeyLengthException.html"title="class in net.ME1312.SubServers.Host.Network">AES.InvalidKeyLengthException</a></span></code>
<divclass="block">Thrown if an attempt is made to encrypt a stream with an invalid AES key length.</div>
<tdclass="colLast"><code><spanclass="memberNameLink"><ahref="../../../../../net/ME1312/SubServers/Host/Network/AES.InvalidPasswordException.html"title="class in net.ME1312.SubServers.Host.Network">AES.InvalidPasswordException</a></span></code>
<divclass="block">Thrown if an attempt is made to decrypt a stream with an incorrect password.</div>
<tdclass="colLast"><code><spanclass="memberNameLink"><ahref="../../../../../net/ME1312/SubServers/Host/Network/AES.StrongEncryptionNotAvailableException.html"title="class in net.ME1312.SubServers.Host.Network">AES.StrongEncryptionNotAvailableException</a></span></code>
<divclass="block">Thrown if 192- or 256-bit AES encryption or decryption is attempted,
but not available on the particular Java platform.</div>
<thclass="colFirst"scope="col">Modifier and Type</th>
<thclass="colLast"scope="col">Method and Description</th>
</tr>
<trid="i0"class="altColor">
<tdclass="colFirst"><code>static <ahref="../../../../../net/ME1312/SubServers/Host/Library/NamedContainer.html"title="class in net.ME1312.SubServers.Host.Library">NamedContainer</a><java.lang.Integer,java.lang.String></code></td>
<divclass="block">Decrypts a stream of data that was encrypted by <ahref="../../../../../net/ME1312/SubServers/Host/Network/AES.html#encrypt-int-java.lang.String-java.io.InputStream-java.io.OutputStream-"><code>encrypt(int, java.lang.String, java.io.InputStream, java.io.OutputStream)</code></a>.</div>
<divclass="block">Decrypts a stream of data that was encrypted by <ahref="../../../../../net/ME1312/SubServers/Host/Network/AES.html#encrypt-int-java.lang.String-java.io.InputStream-java.io.OutputStream-"><code>encrypt(int, java.lang.String, java.io.InputStream, java.io.OutputStream)</code></a>.</div>
throws <ahref="../../../../../net/ME1312/SubServers/Host/Network/AES.InvalidKeyLengthException.html"title="class in net.ME1312.SubServers.Host.Network">AES.InvalidKeyLengthException</a>,
<ahref="../../../../../net/ME1312/SubServers/Host/Network/AES.StrongEncryptionNotAvailableException.html"title="class in net.ME1312.SubServers.Host.Network">AES.StrongEncryptionNotAvailableException</a>,
java.io.IOException</pre>
<divclass="block">Encrypts a stream of data. The encrypted stream consists of a header
followed by the raw AES data. The header is broken down as follows:<br/>
<ul>
<li><b>keyLength</b>: AES key length in bytes (valid for 16, 24, 32) (1 byte)</li>
<li><b>salt</b>: pseudorandom salt used to derive keys from password (16 bytes)</li>
<li><b>authentication key</b> (derived from password and salt, used to
check validity of password upon decryption) (8 bytes)</li>
<dd><code>keyLength</code> - key length to use for AES encryption (must be 128, 192, or 256)</dd>
<dd><code>password</code> - password to use for encryption</dd>
<dd><code>input</code> - an arbitrary byte stream to encrypt</dd>
<dd><code>output</code> - stream to which encrypted data will be written</dd>
<dt><spanclass="throwsLabel">Throws:</span></dt>
<dd><code><ahref="../../../../../net/ME1312/SubServers/Host/Network/AES.InvalidKeyLengthException.html"title="class in net.ME1312.SubServers.Host.Network">AES.InvalidKeyLengthException</a></code> - if keyLength is not 128, 192, or 256</dd>
<dd><code><ahref="../../../../../net/ME1312/SubServers/Host/Network/AES.StrongEncryptionNotAvailableException.html"title="class in net.ME1312.SubServers.Host.Network">AES.StrongEncryptionNotAvailableException</a></code> - if keyLength is 192 or 256, but the Java runtime's jurisdiction
policy files do not allow 192- or 256-bit encryption</dd>
<ahref="../../../../../net/ME1312/SubServers/Host/Network/AES.StrongEncryptionNotAvailableException.html"title="class in net.ME1312.SubServers.Host.Network">AES.StrongEncryptionNotAvailableException</a>,
<ahref="../../../../../net/ME1312/SubServers/Host/Network/AES.InvalidKeyLengthException.html"title="class in net.ME1312.SubServers.Host.Network">AES.InvalidKeyLengthException</a></pre>
<divclass="block">Encrypts a stream of data. The encrypted stream consists of a header
followed by the raw AES data. The header is broken down as follows:<br/>
<ul>
<li><b>keyLength</b>: AES key length in bytes (valid for 16, 24, 32) (1 byte)</li>
<li><b>salt</b>: pseudorandom salt used to derive keys from password (16 bytes)</li>
<li><b>authentication key</b> (derived from password and salt, used to
check validity of password upon decryption) (8 bytes)</li>
<dd><code>keyLength</code> - key length to use for AES encryption (must be 128, 192, or 256)</dd>
<dd><code>password</code> - password to use for encryption</dd>
<dd><code>input</code> - an arbitrary string to encrypt</dd>
<dt><spanclass="returnLabel">Returns:</span></dt>
<dd>string containing the encrypted data</dd>
<dt><spanclass="throwsLabel">Throws:</span></dt>
<dd><code><ahref="../../../../../net/ME1312/SubServers/Host/Network/AES.InvalidKeyLengthException.html"title="class in net.ME1312.SubServers.Host.Network">AES.InvalidKeyLengthException</a></code> - if keyLength is not 128, 192, or 256</dd>
<dd><code><ahref="../../../../../net/ME1312/SubServers/Host/Network/AES.StrongEncryptionNotAvailableException.html"title="class in net.ME1312.SubServers.Host.Network">AES.StrongEncryptionNotAvailableException</a></code> - if keyLength is 192 or 256, but the Java runtime's jurisdiction
policy files do not allow 192- or 256-bit encryption</dd>
throws <ahref="../../../../../net/ME1312/SubServers/Host/Network/AES.InvalidPasswordException.html"title="class in net.ME1312.SubServers.Host.Network">AES.InvalidPasswordException</a>,
<ahref="../../../../../net/ME1312/SubServers/Host/Network/AES.InvalidAESStreamException.html"title="class in net.ME1312.SubServers.Host.Network">AES.InvalidAESStreamException</a>,
java.io.IOException,
<ahref="../../../../../net/ME1312/SubServers/Host/Network/AES.StrongEncryptionNotAvailableException.html"title="class in net.ME1312.SubServers.Host.Network">AES.StrongEncryptionNotAvailableException</a></pre>
<divclass="block">Decrypts a stream of data that was encrypted by <ahref="../../../../../net/ME1312/SubServers/Host/Network/AES.html#encrypt-int-java.lang.String-java.io.InputStream-java.io.OutputStream-"><code>encrypt(int, java.lang.String, java.io.InputStream, java.io.OutputStream)</code></a>.</div>
<dd><code>password</code> - the password used to encrypt/decrypt the stream</dd>
<dd><code>input</code> - stream of encrypted data to be decrypted</dd>
<dd><code>output</code> - stream to which decrypted data will be written</dd>
<dt><spanclass="returnLabel">Returns:</span></dt>
<dd>the key length for the decrypted stream (128, 192, or 256)</dd>
<dt><spanclass="throwsLabel">Throws:</span></dt>
<dd><code><ahref="../../../../../net/ME1312/SubServers/Host/Network/AES.InvalidPasswordException.html"title="class in net.ME1312.SubServers.Host.Network">AES.InvalidPasswordException</a></code> - if the given password was not used to encrypt the data</dd>
<dd><code><ahref="../../../../../net/ME1312/SubServers/Host/Network/AES.InvalidAESStreamException.html"title="class in net.ME1312.SubServers.Host.Network">AES.InvalidAESStreamException</a></code> - if the given input stream is not a valid AES-encrypted stream</dd>
<dd><code><ahref="../../../../../net/ME1312/SubServers/Host/Network/AES.StrongEncryptionNotAvailableException.html"title="class in net.ME1312.SubServers.Host.Network">AES.StrongEncryptionNotAvailableException</a></code> - if the stream is 192 or 256-bit encrypted, and the Java runtime's
jurisdiction policy files do not allow for AES-192 or 256</dd>
<dd><code>java.io.IOException</code></dd>
</dl>
</li>
</ul>
<aname="decrypt-java.lang.String-byte:A-">
<!---->
</a>
<ulclass="blockListLast">
<liclass="blockList">
<h4>decrypt</h4>
<pre>public static <ahref="../../../../../net/ME1312/SubServers/Host/Library/NamedContainer.html"title="class in net.ME1312.SubServers.Host.Library">NamedContainer</a><java.lang.Integer,java.lang.String> decrypt(java.lang.String password,
byte[] input)
throws java.io.IOException,
<ahref="../../../../../net/ME1312/SubServers/Host/Network/AES.StrongEncryptionNotAvailableException.html"title="class in net.ME1312.SubServers.Host.Network">AES.StrongEncryptionNotAvailableException</a>,
<ahref="../../../../../net/ME1312/SubServers/Host/Network/AES.InvalidAESStreamException.html"title="class in net.ME1312.SubServers.Host.Network">AES.InvalidAESStreamException</a>,
<ahref="../../../../../net/ME1312/SubServers/Host/Network/AES.InvalidPasswordException.html"title="class in net.ME1312.SubServers.Host.Network">AES.InvalidPasswordException</a></pre>
<divclass="block">Decrypts a stream of data that was encrypted by <ahref="../../../../../net/ME1312/SubServers/Host/Network/AES.html#encrypt-int-java.lang.String-java.io.InputStream-java.io.OutputStream-"><code>encrypt(int, java.lang.String, java.io.InputStream, java.io.OutputStream)</code></a>.</div>
<dd><code>password</code> - the password used to encrypt/decrypt the string</dd>
<dd><code>input</code> - string of encrypted data to be decrypted</dd>
<dt><spanclass="returnLabel">Returns:</span></dt>
<dd>the key length for the decrypted string (128, 192, or 256) and the string of decrypted data</dd>
<dt><spanclass="throwsLabel">Throws:</span></dt>
<dd><code><ahref="../../../../../net/ME1312/SubServers/Host/Network/AES.InvalidPasswordException.html"title="class in net.ME1312.SubServers.Host.Network">AES.InvalidPasswordException</a></code> - if the given password was not used to encrypt the data</dd>
<dd><code><ahref="../../../../../net/ME1312/SubServers/Host/Network/AES.InvalidAESStreamException.html"title="class in net.ME1312.SubServers.Host.Network">AES.InvalidAESStreamException</a></code> - if the given input stream is not a valid AES-encrypted stream</dd>
<dd><code><ahref="../../../../../net/ME1312/SubServers/Host/Network/AES.StrongEncryptionNotAvailableException.html"title="class in net.ME1312.SubServers.Host.Network">AES.StrongEncryptionNotAvailableException</a></code> - if the stream is 192 or 256-bit encrypted, and the Java runtime's
jurisdiction policy files do not allow for AES-192 or 256</dd>
<li><ahref="../../../../../net/ME1312/SubServers/Host/Network/AES.InvalidAESStreamException.html"title="class in net.ME1312.SubServers.Host.Network"><spanclass="typeNameLink">Next Class</span></a></li>