Package io.anyline.nfc.Tools
Class AES
-
- All Implemented Interfaces:
public class AES
Encryption and decryption using AES.
Daniel Andrade
-
-
Constructor Summary
Constructors Constructor Description AES()
-
Method Summary
Modifier and Type Method Description static Array<byte>
encrypt(Array<byte> myIV, Array<byte> myKey, Array<byte> myMsg)
Encrypt using AES. static Array<byte>
decrypt(Array<byte> myIV, Array<byte> myKey, Array<byte> myMsg)
Decrypt using AES. static Array<byte>
decrypt(Array<byte> myIV, Array<byte> myKey, Array<byte> myMsg, int offset, int length)
Decryption using AES. -
-
Method Detail
-
encrypt
static Array<byte> encrypt(Array<byte> myIV, Array<byte> myKey, Array<byte> myMsg)
Encrypt using AES.
- Parameters:
myIV
- Initialization vector (16 bytes)myKey
- Encryption key (16 bytes)myMsg
- Message to encrypt- Returns:
The cipher text, or null on error.
-
decrypt
static Array<byte> decrypt(Array<byte> myIV, Array<byte> myKey, Array<byte> myMsg)
Decrypt using AES.
- Parameters:
myIV
- Initialization vectormyKey
- Decryption keymyMsg
- Cipher text to decrypt- Returns:
The plain text, or null on error.
-
decrypt
static Array<byte> decrypt(Array<byte> myIV, Array<byte> myKey, Array<byte> myMsg, int offset, int length)
Decryption using AES.
- Parameters:
myIV
- the initialization vectormyKey
- the keymyMsg
- the messageoffset
- the offset within the message, pointing at ciphertextlength
- the length of the ciphertext- Returns:
the plaintext, or
null
on error
-
-
-
-