com.ibm.security.krb5.internal.crypto

Class Des

  1. java.lang.Object
  2. extended bycom.ibm.security.krb5.internal.crypto.Des

  1. public final class Des
  2. extends java.lang.Object

Constructor Summary

Constructor and Description
Des()

Method Summary

Modifier and Type Method and Description
  1. static
  2. boolean
bad_key(byte[] key)
  1. static
  2. boolean
bad_key(long key)
  1. static
  2. void
cbc_encrypt(byte[] input,byte[] output,byte[] key,byte[] ivec,boolean encrypt)
Creates a DES cipher in Electronic Codebook mode, with no padding.
  1. static
  2. 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.
  1. static
  2. byte[]
long2octet(long input)
  1. static
  2. void
long2octet(long input,byte[] output)
  1. static
  2. void
long2octet(long input,byte[] output,int offset)
  1. static
  2. long
octet2long(byte[] input)
  1. static
  2. long
octet2long(byte[] input,int offset)
  1. static
  2. byte[]
set_parity(byte[] key)
  1. static
  2. byte[]
set_parity(byte[] key,int offset)
  1. static
  2. long
set_parity(long key)
  1. static
  2. byte[]
string_to_key_bytes(java.lang.String str)
  1. static
  2. long
string_to_key(java.lang.String str)
Generates DES key from the password.
  1. static
  2. byte[]
string2byte(java.lang.String str)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

Des

  1. public Des()

Method Detail

set_parity

  1. public static final byte[] set_parity( byte[] key,
  2. int offset)

set_parity

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

set_parity

  1. public static final long set_parity( long key)

bad_key

  1. public static final boolean bad_key( long key)

bad_key

  1. public static final boolean bad_key( byte[] key)

octet2long

  1. public static long octet2long(byte[] input)

octet2long

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

long2octet

  1. public static byte[] long2octet( long input)

long2octet

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

long2octet

  1. public static void long2octet(long input,
  2. byte[] output,
  3. int offset)

string2byte

  1. public static byte[] string2byte( java.lang.String str)

cbc_encrypt

  1. public static void cbc_encrypt( byte[] input,
  2. byte[] output,
  3. byte[] key,
  4. byte[] ivec,
  5. boolean encrypt)
  6. throws KrbCryptoException
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.
Throws:

string_to_key

  1. public static long string_to_key( java.lang.String str)
  2. throws KrbCryptoException
Generates DES key from the password.
Parameters:
str - a string used to create the key.
Returns:
DES key.
Throws:

des_cksum

  1. public static byte[] des_cksum( byte[] ivec,
  2. byte[] msg,
  3. byte[] key)
  4. throws KrbCryptoException
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.
Throws:

string_to_key_bytes

  1. public static byte[] string_to_key_bytes( java.lang.String str)
  2. throws KrbCryptoException
Throws: