public final class

Des

extends Object
java.lang.Object
   ↳ sun.security.mule.krb5.internal.crypto.Des

Summary

Fields
private static final long[] bad_keys
private static final byte[] good_parity
Public Constructors
Des()
Public Methods
final static boolean bad_key(byte[] key)
final static boolean bad_key(long key)
static void cbc_encrypt(byte[] input, byte[] output, byte[] key, byte[] ivec, boolean encrypt)
Creates a DES cipher in Electronic Codebook mode, with no padding.
static long char_to_key(char[] passwdChars)
Generates DES key from the password.
static byte[] des_cksum(byte[] ivec, byte[] msg, byte[] key)
Encrypts the message blocks using DES CBC and output the final block of 8-byte ciphertext.
static void long2octet(long input, byte[] output, int offset)
static void long2octet(long input, byte[] output)
static byte[] long2octet(long input)
static long octet2long(byte[] input, int offset)
static long octet2long(byte[] input)
final static byte[] set_parity(byte[] key)
final static long set_parity(long key)
static byte[] string_to_key_bytes(char[] passwdChars)
[Expand]
Inherited Methods
From class java.lang.Object

Fields

private static final long[] bad_keys

private static final byte[] good_parity

Public Constructors

public Des ()

Public Methods

public static final boolean bad_key (byte[] key)

Parameters
key

public static final boolean bad_key (long key)

Parameters
key

public static void cbc_encrypt (byte[] input, byte[] output, byte[] key, byte[] ivec, boolean encrypt)

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

Parameters
input Plain text.
output The buffer for the result.
key DES the key to encrypt the text.
ivec Initialization vector.
encrypt

public static long char_to_key (char[] passwdChars)

Generates DES key from the password.

Parameters
passwdChars
Returns
  • DES key.

public static byte[] des_cksum (byte[] ivec, byte[] msg, byte[] key)

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

Parameters
ivec Initialization vector.
msg Input message as an byte array.
key DES key to encrypt the message.
Returns
  • the last block of ciphertext.

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

Parameters
input
output
offset

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

Parameters
input
output

public static byte[] long2octet (long input)

Parameters
input

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

Parameters
input
offset

public static long octet2long (byte[] input)

Parameters
input

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

Parameters
key

public static final long set_parity (long key)

Parameters
key

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

Parameters
passwdChars