Top Fields Constructors Methods
org.bouncycastle.crypto.params

public Class DESParameters

extends KeyParameter
Class Inheritance
Known Direct Subclasses
org.bouncycastle.crypto.params.DESedeParameters

Field Summary

Modifier and TypeField and Description
public static final int
private static byte[]
private static final int

Constructor Summary

AccessConstructor and Description
public
DESParameters(byte[] key)

Method Summary

Modifier and TypeMethod and Description
public static boolean

Returns:

true if the given DES key material is weak or semi-weak, false otherwise.
isWeakKey
(byte[] key, int offset)

DES has 16 weak keys.

public static void
setOddParity(byte[]
the byte array to set the parity on.
bytes
)

DES Keys use the LSB as the odd parity bit.

Inherited from org.bouncycastle.crypto.params.KeyParameter:
copyTogetKeygetKeyLengthreverse

Field Detail

DES_KEY_LENGTHback to summary
public static final int DES_KEY_LENGTH
DES_weak_keysback to summary
private static byte[] DES_weak_keys
N_DES_WEAK_KEYSback to summary
private static final int N_DES_WEAK_KEYS

Constructor Detail

DESParametersback to summary
public DESParameters(byte[] key)

Method Detail

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

DES has 16 weak keys. This method will check if the given DES key material is weak or semi-weak. Key material that is too short is regarded as weak.

See "Applied Cryptography" by Bruce Schneier for more information.

Returns:boolean

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

setOddParityback to summary
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:byte[]

the byte array to set the parity on.