APIdia Launch Partner
Top Fields Constructors Methods
sun.security.krb5.internal.crypto

public final Class Des

extends Object
Class Inheritance
Imports
javax.crypto.Cipher, .SecretKeyFactory, .SecretKey, javax.crypto.spec.SecretKeySpec, .IvParameterSpec, java.security.GeneralSecurityException, sun.security.krb5.KrbCryptoException, java.util.Arrays

Field Summary

Modifier and TypeField and Description
private static final long[]
private static final String
private static final byte[]

Constructor Summary

AccessConstructor and Description
public
Des()

Method Summary

Modifier and TypeMethod and Description
public static final boolean
bad_key(long key)

public static final boolean
bad_key(byte[] key)

public static void
cbc_encrypt(byte[]
plain text.
input
,
byte[]
the buffer for the result.
output
,
byte[]
DES the key to encrypt the text.
key
,
byte[]
initialization vector.
ivec
,
boolean encrypt)

Creates a DES cipher in Electronic Codebook mode, with no padding.

public static long

Returns:

DES key.
char_to_key
(char[]
a char[] used to create the key.
passwdChars
)

Generates DES key from the password.

public static byte[]

Returns:

the last block of ciphertext.
des_cksum
(byte[]
Initialization vector.
ivec
,
byte[]
Input message as an byte array.
msg
,
byte[]
DES key to encrypt the message.
key
)

Encrypts the message blocks using DES CBC and output the final block of 8-byte ciphertext.

public static byte[]
long2octet(long input)

public static void
long2octet(long input, byte[] output)

public static void
long2octet(long input, byte[] output, int offset)

public static long
octet2long(byte[] input)

public static long
octet2long(byte[] input, int offset)

pack-priv static byte[]

Returns:

the data being padded.
pad
(byte[]
the raw data.
data
)

Pads the data so that its length is a multiple of 8 bytes.

public static final byte[]
set_parity(byte[] key)

public static final long
set_parity(long key)

public static byte[]
string_to_key_bytes(char[] passwdChars)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bad_keysback to summary
private static final long[] bad_keys
CHARSETback to summary
private static final String CHARSET
good_parityback to summary
private static final byte[] good_parity

Constructor Detail

Desback to summary
public Des()

Method Detail

bad_keyback to summary
public static final boolean bad_key(long key)
bad_keyback to summary
public static final boolean bad_key(byte[] key)
cbc_encryptback to summary
public static void cbc_encrypt(byte[] input, byte[] output, byte[] key, byte[] ivec, boolean encrypt) throws KrbCryptoException

Creates a DES cipher in Electronic Codebook mode, with no padding.

Parameters
input:byte[]

plain text.

output:byte[]

the buffer for the result.

key:byte[]

DES the key to encrypt the text.

ivec:byte[]

initialization vector.

char_to_keyback to summary
public static long char_to_key(char[] passwdChars) throws KrbCryptoException

Generates DES key from the password.

Parameters
passwdChars:char[]

a char[] used to create the key.

Returns:long

DES key.

des_cksumback to summary
public static byte[] des_cksum(byte[] ivec, byte[] msg, byte[] key) throws KrbCryptoException

Encrypts the message blocks using DES CBC and output the final block of 8-byte ciphertext.

Parameters
ivec:byte[]

Initialization vector.

msg:byte[]

Input message as an byte array.

key:byte[]

DES key to encrypt the message.

Returns:byte[]

the last block of ciphertext.

long2octetback to summary
public static byte[] long2octet(long input)
long2octetback to summary
public static void long2octet(long input, byte[] output)
long2octetback to summary
public static void long2octet(long input, byte[] output, int offset)
octet2longback to summary
public static long octet2long(byte[] input)
octet2longback to summary
public static long octet2long(byte[] input, int offset)
padback to summary
pack-priv static byte[] pad(byte[] data)

Pads the data so that its length is a multiple of 8 bytes.

Parameters
data:byte[]

the raw data.

Returns:byte[]

the data being padded.

set_parityback to summary
public static final byte[] set_parity(byte[] key)
set_parityback to summary
public static final long set_parity(long key)
string_to_key_bytesback to summary
public static byte[] string_to_key_bytes(char[] passwdChars) throws KrbCryptoException