public final class SymCipher extends java.lang.Object implements ISymCipher
Modifier and Type | Field and Description |
---|---|
static int |
CTR |
static int |
NO_ENCRYPTION |
static int |
OFB |
static int |
UNKNOWN_ALGORITHM |
Constructor and Description |
---|
SymCipher()
Creates a new SymCipher object with two AES engines and two zero'd
initialization vectors.
|
Modifier and Type | Method and Description |
---|---|
int |
encryptAES1(byte[] src,
int s_offset,
byte[] dest,
int d_offset,
int len)
The AES encryption uses a Output Feedback Block Cipher.
|
int |
encryptAES2(byte[] buff)
The AES encryption uses a Output Feedback Block Cipher.
|
static int |
getAlgorithmForName(java.lang.String strAlg) |
byte[] |
getKeys()
Returns the currently used key(s) for encryption.
|
int |
setEncryptionKeyAES(byte[] key)
Sets the AES encryption key to the first 16 byte of the the key buffer.
|
int |
setEncryptionKeyAES(byte[] key,
int offset,
int len) |
int |
setEncryptionKeysAES(byte[] keys)
Set both keys to different value, if keys.length==2* KEY_SIZE, else set
both keys to the same value
|
void |
setIV2(byte[] buff) |
public static final int NO_ENCRYPTION
public static final int OFB
public static final int CTR
public static final int UNKNOWN_ALGORITHM
public SymCipher()
public int setEncryptionKeyAES(byte[] key)
setEncryptionKeyAES
in interface ISymCipher
public int setEncryptionKeyAES(byte[] key, int offset, int len)
setEncryptionKeyAES
in interface ISymCipher
key
- byte[]offset
- intlen
- int if len==16 --> only the key is set; if len==32 --> key and
IV is setpublic int setEncryptionKeysAES(byte[] keys)
ISymCipher
setEncryptionKeysAES
in interface ISymCipher
keys
- byte[]public byte[] getKeys()
ISymCipher
getKeys
in interface ISymCipher
public void setIV2(byte[] buff)
setIV2
in interface ISymCipher
public int encryptAES1(byte[] src, int s_offset, byte[] dest, int d_offset, int len)
encryptAES1
in interface ISymCipher
public int encryptAES2(byte[] buff)
encryptAES2
in interface ISymCipher
public static int getAlgorithmForName(java.lang.String strAlg)
Copyright © 2023. All rights reserved.