net.i2p.crypto
Class CryptixAESEngine
java.lang.Object
net.i2p.crypto.AESEngine
net.i2p.crypto.CryptixAESEngine
- public class CryptixAESEngine
- extends AESEngine
Wrapper for AES cypher operation using Cryptix's Rijndael implementation. Implements
CBC with a 16 byte IV.
Problems:
Only supports data of size mod 16 bytes - no inherent padding.
- Author:
- jrandom, thecrypto
Method Summary |
void |
decrypt(byte[] payload,
int payloadIndex,
byte[] out,
int outIndex,
SessionKey sessionKey,
byte[] iv,
int length)
Decrypt the data with the session key |
void |
decryptBlock(byte[] payload,
int inIndex,
SessionKey sessionKey,
byte[] rv,
int outIndex)
decrypt the data with the session key provided |
void |
encrypt(byte[] payload,
int payloadIndex,
byte[] out,
int outIndex,
SessionKey sessionKey,
byte[] iv,
int length)
Encrypt the payload with the session key |
void |
encryptBlock(byte[] payload,
int inIndex,
SessionKey sessionKey,
byte[] out,
int outIndex)
|
static void |
main(java.lang.String[] args)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CryptixAESEngine
public CryptixAESEngine(I2PAppContext context)
encrypt
public void encrypt(byte[] payload,
int payloadIndex,
byte[] out,
int outIndex,
SessionKey sessionKey,
byte[] iv,
int length)
- Description copied from class:
AESEngine
- Encrypt the payload with the session key
- Overrides:
encrypt
in class AESEngine
- Parameters:
payload
- data to be encryptedpayloadIndex
- index into the payload to start encryptingout
- where to store the resultoutIndex
- where in out to start writingsessionKey
- private esession key to encrypt toiv
- IV for CBClength
- how much data to encrypt
decrypt
public void decrypt(byte[] payload,
int payloadIndex,
byte[] out,
int outIndex,
SessionKey sessionKey,
byte[] iv,
int length)
- Description copied from class:
AESEngine
- Decrypt the data with the session key
- Overrides:
decrypt
in class AESEngine
- Parameters:
payload
- data to be decryptedpayloadIndex
- index into the payload to start decryptingout
- where to store the cleartextoutIndex
- where in out to start writingsessionKey
- private session key to decrypt toiv
- IV for CBClength
- how much data to decrypt
encryptBlock
public final void encryptBlock(byte[] payload,
int inIndex,
SessionKey sessionKey,
byte[] out,
int outIndex)
- Overrides:
encryptBlock
in class AESEngine
decryptBlock
public final void decryptBlock(byte[] payload,
int inIndex,
SessionKey sessionKey,
byte[] rv,
int outIndex)
- decrypt the data with the session key provided
- Overrides:
decryptBlock
in class AESEngine
- Parameters:
payload
- encrypted datasessionKey
- private session key
- Returns:
- unencrypted data
main
public static void main(java.lang.String[] args)