anon.client.crypto
Class SymCipher
java.lang.Object
anon.client.crypto.SymCipher
public class SymCipher
- extends java.lang.Object
Field Summary |
(package private) org.bouncycastle.crypto.engines.AESFastEngine |
aesEngine
|
(package private) byte[] |
iv
|
(package private) byte[] |
iv2
|
(package private) byte[] |
m_aesKey
|
Method Summary |
int |
encryptAES(byte[] buff)
|
int |
encryptAES(byte[] from,
int ifrom,
byte[] to,
int ito,
int len)
|
int |
encryptAES2(byte[] buff)
|
int |
encryptAES2(byte[] from,
int ifrom,
byte[] to,
int ito,
int len)
|
byte[] |
getKey()
Returns the currently used key for encryption. |
int |
setEncryptionKeyAES(byte[] key)
|
int |
setEncryptionKeyAES(byte[] key,
int offset,
int len)
|
void |
setIV2(byte[] buff)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
aesEngine
org.bouncycastle.crypto.engines.AESFastEngine aesEngine
iv
byte[] iv
iv2
byte[] iv2
m_aesKey
byte[] m_aesKey
SymCipher
public SymCipher()
setEncryptionKeyAES
public int setEncryptionKeyAES(byte[] key)
setEncryptionKeyAES
public int setEncryptionKeyAES(byte[] key,
int offset,
int len)
- Parameters:
key
- byte[]offset
- intlen
- int if len==16 --> only the key is set; if len==32 --> key and IV
is set
- Returns:
- int
getKey
public byte[] getKey()
- Returns the currently used key for encryption.
- Returns:
- The current key used for encryption or null, if no key is set.
setIV2
public void setIV2(byte[] buff)
encryptAES
public int encryptAES(byte[] buff)
encryptAES
public int encryptAES(byte[] from,
int ifrom,
byte[] to,
int ito,
int len)
encryptAES2
public int encryptAES2(byte[] buff)
encryptAES2
public int encryptAES2(byte[] from,
int ifrom,
byte[] to,
int ito,
int len)