RADIUS Client API (V3)

com.theorem.radius3.radutil
Class SecretAmplification

Object
  extended bySecretAmplification

public class SecretAmplification
extends Object

Class to implement 'RADIUS Shared Secret Security Amplification'.

From draft-funk-radiusext-shared-secret-amp-01.txt:
"This draft describes how a mechanism defined in [PKCS-5] can be used to amplify the security of a RADIUS shared secret; namely, that a precursor secret is hashed many times to produce an amplified shared secret for use in RADIUS.

"A dictionary attack against the resulting shared secret will be infeasible due to its high entropy. A dictionary attack against the precursor secret will require the attacker to apply the same hashing process to each candidate precursor secret to derive a candidate RADIUS shared secret, prior to applying it to the RADIUS packet.

"This approach allows administrators to use the same types of secrets that they are comfortable with as precursor secrets. The algorithm to generate the amplified shared secret is deterministic, so the precursor shared secret is all that needs to be remembered.

"Unlike approaches that require changes to RADIUS servers and clients, the amplification approach is compatible with all current equipment. It is simply a means to generate a shared secret, which then may be configured in the NAS or RADIUS server just as any shared secret would be. For example, a simple utility can accept the precursor secret, amplify it, and present it to the administrator, who may copy and paste it into the configuration application of a RADIUS server or NAS."

The result is a 12 character amplified secret instead of a weak, guessable secret. For example a RADIUS client secret of 'testpassword' and using a salt of 'testsalt' results in 'D0z7aIJHzLLGtpj2'. The salt value is optional but increases the entropy of the amplified password.

This does not run very quickly as it's performing over a million SHA-1 HMAC computations. However it does take simple, guessable passwords and makes them a little more difficult to crack.


Field Summary
static int DKLEN
          Length of output - 12.
static int ITERATIONS
          Iterations for the algorithm - 1048576.
 
Constructor Summary
SecretAmplification(byte[] precursorSecret, byte[] salt)
          Constructor using the default number of iterations and the standard derived key length.
SecretAmplification(byte[] precursorSecret, byte[] salt, int iterations, int dkLen)
          Constructor.
 
Method Summary
 byte[] amplify()
          Amplify the precursor secret.
static void main(String[] a)
          Test of the secret amplification.
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ITERATIONS

public static final int ITERATIONS
Iterations for the algorithm - 1048576.

See Also:
Constant Field Values

DKLEN

public static final int DKLEN
Length of output - 12.

See Also:
Constant Field Values
Constructor Detail

SecretAmplification

public SecretAmplification(byte[] precursorSecret,
                           byte[] salt)
                    throws NoSuchAlgorithmException,
                           InvalidKeyException
Constructor using the default number of iterations and the standard derived key length.

Parameters:
precursorSecret - Precursor secret - a string representing an easy to remember secret - UTF-8 encoded.
salt - Salt value. This is optional and may be null or empty - UTF-8 encoded.
Throws:
NoSuchAlgorithmException - if the SHA-1 hash is not available.
InvalidKeyException

SecretAmplification

public SecretAmplification(byte[] precursorSecret,
                           byte[] salt,
                           int iterations,
                           int dkLen)
                    throws IllegalArgumentException,
                           NoSuchAlgorithmException,
                           InvalidKeyException
Constructor.

Parameters:
precursorSecret - Precursor secret - a string representing an easy to remember secret - UTF-8 encoded.
salt - Salt value. This is optional and may be null or empty - UTF-8 encoded.
iterations - Number of iterations of the algorithm.
dkLen - The number of octets of binary output.
Throws:
IllegalArgumentException - if dkLen is too long.
NoSuchAlgorithmException - if the SHA-1 hash is not available.
InvalidKeyException
Method Detail

amplify

public byte[] amplify()
Amplify the precursor secret.

Returns:
The 12 byte representation of the secret in US-ACSII. This is safe for use as is for a secret.

main

public static void main(String[] a)
Test of the secret amplification. The first argument is the secret (or password) to amplify. The second argument is the salf value, if any.


RADIUS Client API (V3)

Submit a bug report or feature request

Copyright 1998-2008 AXL Software. PO Box 97, Viola, Delaware 19979, U.S.A. All Rights Reserved.