public class MyAES
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private mybouncycastle.org.bouncycastle.crypto.engines.AESFastEngine |
m_AES
Stores the used AES encryption algorithm.
|
private byte[] |
m_arCounter
Same variables for CTR mode
|
private byte[] |
m_arCounterOut |
private int |
m_posCTR |
Constructor and Description |
---|
MyAES()
Creates a new instance of Aes.
|
Modifier and Type | Method and Description |
---|---|
void |
init(boolean bEncrypt,
byte[] a_aesKey)
Initialises instance of Aes for encryption or decryption.
|
void |
init(boolean bEncrypt,
byte[] a_aesKey,
int off,
int len)
Initialises instance of Aes for encryption or decryption.
|
byte[] |
processBlockECB(byte[] a_plainData)
Encrypts/Decrypts one single plain data block and returns the cipher data block.
|
void |
processBlockECB(byte[] a_InData,
byte[] a_OutData)
Encrypts/Decrypts one single plain data block and returns the cipher data block.
|
void |
processBytesCTR(byte[] in,
int inOff,
byte[] out,
int outOff,
int len) |
private mybouncycastle.org.bouncycastle.crypto.engines.AESFastEngine m_AES
private byte[] m_arCounter
private byte[] m_arCounterOut
private int m_posCTR
public void init(boolean bEncrypt, byte[] a_aesKey) throws java.lang.Exception
a_aesKey
- The 128 bit or 192 bit or 256 bit AES key.java.lang.Exception
public void init(boolean bEncrypt, byte[] a_aesKey, int off, int len) throws java.lang.Exception
a_aesKey
- The 128 bit or 192 bit or 256 bit AES key.java.lang.Exception
public void processBlockECB(byte[] a_InData, byte[] a_OutData) throws java.lang.Exception
a_plainData
- The plain data block.java.lang.Exception
public byte[] processBlockECB(byte[] a_plainData) throws java.lang.Exception
a_plainData
- The plain data block.java.lang.Exception
public void processBytesCTR(byte[] in, int inOff, byte[] out, int outOff, int len) throws java.lang.Exception
java.lang.Exception
Copyright © 2023. All rights reserved.