org.bouncycastle.crypto.params

Class DESParameters

Implemented Interfaces:
CipherParameters
Known Direct Subclasses:
DESedeParameters

public class DESParameters
extends KeyParameter

Field Summary

static int
DES_KEY_LENGTH

Constructor Summary

DESParameters(byte[] key)

Method Summary

static boolean
isWeakKey(byte[] key, int offset)
DES has 16 weak keys.
static void
setOddParity(byte[] bytes)
DES Keys use the LSB as the odd parity bit.

Methods inherited from class org.bouncycastle.crypto.params.KeyParameter

getKey

Field Details

DES_KEY_LENGTH

public static final int DES_KEY_LENGTH

Field Value:
8

Constructor Details

DESParameters

public DESParameters(byte[] key)

Method Details

isWeakKey

public static boolean isWeakKey(byte[] key,
                                int offset)

Returns:
true if the given DES key material is weak or semi-weak, false otherwise.


setOddParity

public static void setOddParity(byte[] bytes)
DES Keys use the LSB as the odd parity bit. This can be used to check for corrupt keys.

Parameters:
bytes - the byte array to set the parity on.