|
|||||||||
Home >> All >> cryptix >> jce >> provider >> [ key overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: ![]() ![]() ![]() |
DETAIL: FIELD | CONSTR | METHOD |
cryptix.jce.provider.key
Class RC4KeyGenerator

java.lang.Objectjavax.crypto.KeyGeneratorSpi
cryptix.jce.provider.key.RawKeyGenerator
cryptix.jce.provider.key.RC4KeyGenerator
- public class RC4KeyGenerator
- extends RawKeyGenerator
A key generator for RC4.
Key length between 40 and 1024 bits inclusive (increments of 8). Default length is 128 bits.
References:
- Andrew Roos <andrewr@vironix.co.za> (Vironix Software Laboratories), A Class of Weak Keys in the RC4 Stream Cipher, Preliminary draft posted to sci.crypt, 4th November 1997.
- Version:
- $Revision: 1.6 $
Constructor Summary | |
RC4KeyGenerator()
|
Method Summary | |
protected javax.crypto.SecretKey |
engineGenerateKey()
Generate a key, returning it as a javax.crypto.SecretKey. |
protected void |
engineInit(java.security.spec.AlgorithmParameterSpec params,
java.security.SecureRandom random)
Initialize this key generator with parameters and a source of randomness. |
protected void |
engineInit(int keysize,
java.security.SecureRandom random)
Initialize this key generator with a key size (in bits) and a source of randomness. |
protected void |
engineInit(java.security.SecureRandom random)
Initialize this key generator with a source of randomness; the implementation should use reasonable default parameters (such as generated key size). |
protected byte[] |
fixUp(byte[] key)
Fix up the generated and purely random bytes. |
protected boolean |
isValidSize(int size)
40 <= size <= 1024 |
protected boolean |
isWeak(byte[] key)
Returns true iff key is a weak RC4 key, as described in Andrew Roos' paper. |
protected int |
strengthToBits(int strength)
Translates strength (complexity, 56 for DES) to bit length (64 for DES). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
RC4KeyGenerator
public RC4KeyGenerator()
Method Detail |
isWeak
protected boolean isWeak(byte[] key)
- Returns true iff key is a weak RC4 key, as described in Andrew
Roos' paper.
- Specified by:
isWeak
in classRawKeyGenerator
isValidSize
protected boolean isValidSize(int size)
- 40 <= size <= 1024
- Specified by:
isValidSize
in classRawKeyGenerator
engineInit
protected void engineInit(java.security.SecureRandom random)
- Description copied from class:
javax.crypto.KeyGeneratorSpi
- Initialize this key generator with a source of randomness; the
implementation should use reasonable default parameters (such as
generated key size).
engineInit
protected void engineInit(java.security.spec.AlgorithmParameterSpec params, java.security.SecureRandom random) throws java.security.InvalidAlgorithmParameterException
- Description copied from class:
javax.crypto.KeyGeneratorSpi
- Initialize this key generator with parameters and a source of
randomness.
engineInit
protected void engineInit(int keysize, java.security.SecureRandom random)
- Description copied from class:
javax.crypto.KeyGeneratorSpi
- Initialize this key generator with a key size (in bits) and a
source of randomness.
engineGenerateKey
protected javax.crypto.SecretKey engineGenerateKey()
- Description copied from class:
javax.crypto.KeyGeneratorSpi
- Generate a key, returning it as a javax.crypto.SecretKey.
strengthToBits
protected int strengthToBits(int strength)
- Translates strength (complexity, 56 for DES) to bit length
(64 for DES).
fixUp
protected byte[] fixUp(byte[] key)
- Fix up the generated and purely random bytes. For DES this would
fix the parity.
|
|||||||||
Home >> All >> cryptix >> jce >> provider >> [ key overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: ![]() ![]() ![]() |
DETAIL: FIELD | CONSTR | METHOD |