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 ISymCipherpublic int setEncryptionKeyAES(byte[] key,
int offset,
int len)
setEncryptionKeyAES in interface ISymCipherkey - byte[]offset - intlen - int if len==16 --> only the key is set; if len==32 --> key and
IV is setpublic int setEncryptionKeysAES(byte[] keys)
ISymCiphersetEncryptionKeysAES in interface ISymCipherkeys - byte[]public byte[] getKeys()
ISymCiphergetKeys in interface ISymCipherpublic void setIV2(byte[] buff)
setIV2 in interface ISymCipherpublic int encryptAES1(byte[] src,
int s_offset,
byte[] dest,
int d_offset,
int len)
encryptAES1 in interface ISymCipherpublic int encryptAES2(byte[] buff)
encryptAES2 in interface ISymCipherpublic static int getAlgorithmForName(java.lang.String strAlg)
Copyright © 2023. All rights reserved.