public class

ArcFourCrypto

extends DkCrypto
java.lang.Object
   ↳ sun.security.mule.krb5.internal.crypto.dk.DkCrypto
     ↳ sun.security.mule.krb5.internal.crypto.dk.ArcFourCrypto

Class Overview

Support for ArcFour in Kerberos as defined in RFC 4757. http://www.ietf.org/rfc/rfc4757.txt

Summary

Constants
int confounderSize
boolean debug
int hashSize
[Expand]
Inherited Constants
From class sun.security.mule.krb5.internal.crypto.dk.DkCrypto
Fields
private static final byte[] ZERO_IV
private final int keyLength
[Expand]
Inherited Fields
From class sun.security.mule.krb5.internal.crypto.dk.DkCrypto
Public Constructors
ArcFourCrypto(int length)
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, byte[] seqNum)
Decrypts data using specified key and initial vector.
byte[] decryptSeq(byte[] baseKey, int usage, byte[] checksum, byte[] ciphertext, int start, int len)
Performs decryption of Sequence Number using derived key.
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[] seqNum, byte[] plaintext, int start, int len)
Performs encryption using derived key; does not add confounder.
byte[] encryptSeq(byte[] baseKey, int usage, byte[] checksum, byte[] plaintext, int start, int len)
Performs encryption of Sequence Number using derived key.
int getChecksumLength()
byte[] stringToKey(char[] passwd)
Protected Methods
Cipher getCipher(byte[] key, byte[] ivec, int mode)
byte[] getHmac(byte[] key, byte[] msg)
Get the HMAC-MD5
int getKeySeedLength()
byte[] randomToKey(byte[] in)
[Expand]
Inherited Methods
From class sun.security.mule.krb5.internal.crypto.dk.DkCrypto
From class java.lang.Object

Constants

private static final int confounderSize

Constant Value: 8 (0x00000008)

private static final boolean debug

Constant Value: false

private static final int hashSize

Constant Value: 16 (0x00000010)

Fields

private static final byte[] ZERO_IV

private final int keyLength

Public Constructors

public ArcFourCrypto (int length)

Parameters
length

Public Methods

public byte[] calculateChecksum (byte[] baseKey, int usage, byte[] input, int start, int len)

Calculate the checksum

Parameters
baseKey
usage
input
start
len
Throws
GeneralSecurityException

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
Throws
GeneralSecurityException

public byte[] decryptRaw (byte[] baseKey, int usage, byte[] ivec, byte[] ciphertext, int start, int len, byte[] seqNum)

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
seqNum
Throws
GeneralSecurityException

public byte[] decryptSeq (byte[] baseKey, int usage, byte[] checksum, byte[] ciphertext, int start, int len)

Performs decryption of Sequence Number using derived key.

Parameters
baseKey
usage
checksum
ciphertext
start
len
Throws
GeneralSecurityException
KrbCryptoException

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
Throws
GeneralSecurityException
KrbCryptoException

public byte[] encryptRaw (byte[] baseKey, int usage, byte[] seqNum, byte[] plaintext, int start, int len)

Performs encryption using derived key; does not add confounder.

Parameters
baseKey
usage
seqNum
plaintext
start
len
Throws
GeneralSecurityException
KrbCryptoException

public byte[] encryptSeq (byte[] baseKey, int usage, byte[] checksum, byte[] plaintext, int start, int len)

Performs encryption of Sequence Number using derived key.

Parameters
baseKey
usage
checksum
plaintext
start
len
Throws
GeneralSecurityException
KrbCryptoException

public int getChecksumLength ()

public byte[] stringToKey (char[] passwd)

Parameters
passwd
Throws
GeneralSecurityException

Protected Methods

protected Cipher getCipher (byte[] key, byte[] ivec, int mode)

Parameters
key
ivec
mode
Throws
GeneralSecurityException

protected byte[] getHmac (byte[] key, byte[] msg)

Get the HMAC-MD5

Parameters
key
msg
Throws
GeneralSecurityException

protected int getKeySeedLength ()

protected byte[] randomToKey (byte[] in)

Parameters
in