Class Overview
This class provides the implementation of AES Encryption for Kerberos
as defined RFC 3962.
http://www.ietf.org/rfc/rfc3962.txt
Algorithm profile described in [KCRYPTO]:
+--------------------------------------------------------------------+
| protocol key format 128- or 256-bit string |
| |
| string-to-key function PBKDF2+DK with variable |
| iteration count (see |
| above) |
| |
| default string-to-key parameters 00 00 10 00 |
| |
| key-generation seed length key size |
| |
| random-to-key function identity function |
| |
| hash function, H SHA-1 |
| |
| HMAC output size, h 12 octets (96 bits) |
| |
| message block size, m 1 octet |
| |
| encryption/decryption functions, AES in CBC-CTS mode |
| E and D (cipher block size 16 |
| octets), with next to |
| last block as CBC-style |
| ivec |
+--------------------------------------------------------------------+
Supports AES128 and AES256
Summary
| Public Methods |
|
byte[]
|
calculateChecksum(byte[] baseKey, int usage, byte[] input, int start, int len)
Calculate the checksum
|
|
byte[]
|
decrypt(byte[] baseKey, int usage, byte[] ivec, byte[] ciphertext, int start, int len)
|
|
byte[]
|
decryptRaw(byte[] baseKey, int usage, byte[] ivec, byte[] ciphertext, int start, int len)
Decrypts data using specified key and initial vector.
|
|
byte[]
|
encrypt(byte[] baseKey, int usage, byte[] ivec, byte[] new_ivec, byte[] plaintext, int start, int len)
Performs encryption using derived key; adds confounder.
|
|
byte[]
|
encryptRaw(byte[] baseKey, int usage, byte[] ivec, byte[] plaintext, int start, int len)
Performs encryption using derived key; does not add confounder.
|
|
int
|
getChecksumLength()
|
|
final
static
int
|
readBigEndian(byte[] data, int pos, int size)
|
|
byte[]
|
stringToKey(char[] password, String salt, byte[] s2kparams)
|
|
[Expand]
Inherited Methods |
From class
sun.security.mule.krb5.internal.crypto.dk.DkCrypto
|
byte[]
|
calculateChecksum(byte[] baseKey, int usage, byte[] input, int start, int len)
|
|
byte[]
|
decrypt(byte[] baseKey, int usage, byte[] ivec, byte[] ciphertext, int start, int len)
|
|
byte[]
|
decryptRaw(byte[] baseKey, int usage, byte[] ivec, byte[] ciphertext, int start, int len)
Decrypts data using specified key and initial vector.
|
|
byte[]
|
encrypt(byte[] baseKey, int usage, byte[] ivec, byte[] new_ivec, byte[] plaintext, int start, int len)
From RFC 3961.
|
|
byte[]
|
encryptRaw(byte[] baseKey, int usage, byte[] ivec, byte[] plaintext, int start, int len)
Performs encryption using given key only; does not add
confounder, padding, or checksum.
|
|
abstract
int
|
getChecksumLength()
|
|
abstract
Cipher
|
getCipher(byte[] key, byte[] ivec, int mode)
|
|
abstract
byte[]
|
getHmac(byte[] key, byte[] plaintext)
|
|
abstract
int
|
getKeySeedLength()
|
|
abstract
byte[]
|
randomToKey(byte[] in)
|
|
From class
java.lang.Object
|
Object
|
clone()
|
|
boolean
|
equals(Object arg0)
|
|
void
|
finalize()
|
|
final
Class<?>
|
getClass()
|
|
int
|
hashCode()
|
|
final
void
|
notify()
|
|
final
void
|
notifyAll()
|
|
String
|
toString()
|
|
final
void
|
wait()
|
|
final
void
|
wait(long arg0, int arg1)
|
|
final
void
|
wait(long arg0)
|
|
Constants
private
static
final
int
BLOCK_SIZE
Constant Value:
16
(0x00000010)
private
static
final
int
DEFAULT_ITERATION_COUNT
Constant Value:
4096
(0x00001000)
private
static
final
boolean
debug
private
static
final
int
hashSize
Constant Value:
12
(0x0000000c)
Fields
private
static
final
byte[]
ZERO_IV
private
final
int
keyLength
Public Constructors
public
AesDkCrypto
(int length)
Public Methods
public
byte[]
calculateChecksum
(byte[] baseKey, int usage, byte[] input, int start, int len)
Parameters
| baseKey
| |
| usage
| |
| input
| |
| start
| |
| len
| |
public
byte[]
decrypt
(byte[] baseKey, int usage, byte[] ivec, byte[] ciphertext, int start, int len)
Parameters
| baseKey
| Key from which keys are to be derived using usage |
| usage
| |
| ivec
| |
| ciphertext
| E(Ke, conf | plaintext | padding, ivec) | H1[1..h]
|
| start
| |
| len
| |
public
byte[]
decryptRaw
(byte[] baseKey, int usage, byte[] ivec, byte[] ciphertext, int start, int len)
Decrypts data using specified key and initial vector.
Parameters
| baseKey
| Encryption key to use |
| usage
| Ignored
|
| ivec
| |
| ciphertext
| Encrypted data to be decrypted |
| start
| |
| len
| |
public
byte[]
encrypt
(byte[] baseKey, int usage, byte[] ivec, byte[] new_ivec, byte[] plaintext, int start, int len)
Performs encryption using derived key; adds confounder.
Parameters
| baseKey
| |
| usage
| |
| ivec
| Initial vector to use when initializing the cipher; if null,
then blocksize number of zeros are used, |
| new_ivec
| If non-null, it is updated upon return to be the
new ivec to use when calling encrypt next time
|
| plaintext
| |
| start
| |
| len
| |
public
byte[]
encryptRaw
(byte[] baseKey, int usage, byte[] ivec, byte[] plaintext, int start, int len)
Performs encryption using derived key; does not add confounder.
Parameters
| baseKey
| |
| usage
| |
| ivec
| |
| plaintext
| |
| start
| |
| len
| |
public
int
getChecksumLength
()
public
static
final
int
readBigEndian
(byte[] data, int pos, int size)
public
byte[]
stringToKey
(char[] password, String salt, byte[] s2kparams)
Protected Methods
protected
Cipher
getCipher
(byte[] key, byte[] ivec, int mode)
protected
byte[]
getHmac
(byte[] key, byte[] msg)
protected
int
getKeySeedLength
()
protected
byte[]
randomToKey
(byte[] in)