|
AXL Software® | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectRADIUSEncrypt
Encrypt a password in the RADIUS style. This creates a new authenticator, or encrypts the password. This might be useful in an Access-Challenge.
| Field Summary | |
static String |
encoding
Default encoding is UTF8 for passwords. |
| Constructor Summary | |
RADIUSEncrypt()
|
|
| Method Summary | |
static boolean |
cmp(byte[] a,
byte[] b)
Compare two byte arrays. |
static byte[] |
decipherTunnelPassword(byte[] data,
byte[] secret,
byte[] authenticator)
Decipher a Tunnel-Password attribute value; this is known as encoding type 2. |
static byte[] |
decrypt(byte[] encBytes,
byte[] secretBytes,
byte[] authenticator)
Decode a PAP password from the User-Password attribute, the secret, and the authenticator also known as type 1 encoding. |
static byte[] |
encipherTunnelPassword(byte[] data,
byte[] secret,
byte[] authenticator)
Deprecated. Please see saltEncode(byte[] salt, byte[] data, byte[] secret, byte[] authenticator). |
static byte[] |
encode3(byte[] data,
byte[] secretBytes,
byte[] authenticator)
Ascend encoding also known as type 3 encoding providing bidirectional encoding/decoding. |
static byte[] |
encrypt(byte[] password,
byte[] secretBytes,
byte[] authenticator)
Encrypt the PAP password, also known as encoding type 1. |
static byte[] |
genAuthenticator()
Generate the RADIUS authenticator. |
static byte[] |
limitSecretLength(byte[] data)
Limit the maximum amount of data the shared secret to 128 bits (16 bytes). |
static byte[] |
password(byte[] pwdBytes,
byte[] secretBytes,
byte[] authenticator)
Encrypt the PAP password. |
static byte[] |
password(String password,
byte[] secretBytes,
byte[] authenticator)
Encrypt the password. |
static byte[] |
password(String password,
String secret,
byte[] authenticator)
Encrypt the password. |
static byte[] |
password(String password,
String passwordEnc,
byte[] secretBytes,
byte[] authenticator)
Deprecated. Encoding for RADIUS is always UTF8. |
static byte[] |
password(String password,
String passwordEnc,
String secret,
String secretEnc,
byte[] authenticator)
Encrypt the password. |
static byte[] |
saltDecode(byte[] data,
byte[] secret,
byte[] authenticator)
Decode data encoded using a two byte salt value. |
static byte[] |
saltEncode(byte[] data,
byte[] secret,
byte[] authenticator)
Encode data using a random two byte salt value. |
static byte[] |
saltEncode(byte[] salt,
byte[] data,
byte[] secret,
byte[] authenticator)
Encode data using a two byte salt value. |
static byte[] |
trim(byte[] passwordBytes)
Remove nulls from the end of the password byte array from decrypt. |
| Methods inherited from class Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final String encoding
| Constructor Detail |
public RADIUSEncrypt()
| Method Detail |
public static byte[] password(String password,
String passwordEnc,
String secret,
String secretEnc,
byte[] authenticator)
password - Password to encrypt.passwordEnc - character encoding.secret - NAS secret used in encryption.secretEnc - NAS secret character encoding.authenticator - Authenticator from packet.
public static byte[] password(String password,
String secret,
byte[] authenticator)
password - Password to encrypt.secret - NAS secret used in encryption.authenticator - Authenticator from packet.
public static byte[] password(String password,
String passwordEnc,
byte[] secretBytes,
byte[] authenticator)
password - Password to encrypt.passwordEnc - character encoding.secretBytes - NAS secret used in encryption as a byte array.authenticator - Authenticator from packet.
public static byte[] password(String password,
byte[] secretBytes,
byte[] authenticator)
password - Password to encrypt.secretBytes - NAS secret used in encryption as a byte array.authenticator - Authenticator from packet.
public static byte[] password(byte[] pwdBytes,
byte[] secretBytes,
byte[] authenticator)
pwdBytes - Password to encrypt as a byte arraysecretBytes - NAS secret as a byte array.authenticator - Authenticator from packet.
public static byte[] saltEncode(byte[] salt,
byte[] data,
byte[] secret,
byte[] authenticator)
salt - Two byte salt value.data - Data to encode.secret - RADIUS shared secret.authenticator - RADIUS authenticator.
public static byte[] saltEncode(byte[] data,
byte[] secret,
byte[] authenticator)
data - Data to encipher.secret - RADIUS shared secret.authenticator - RADIUS authenticator.
public static byte[] saltDecode(byte[] data,
byte[] secret,
byte[] authenticator)
data - Data to decode.secret - RADIUS shared secret.authenticator - RADIUS authenticator.
public static byte[] encipherTunnelPassword(byte[] data,
byte[] secret,
byte[] authenticator)
saltEncode(byte[] salt, byte[] data, byte[] secret, byte[] authenticator).
data - Plain text data to encode.secret - Shared secret.authenticator - Radius request authenticator.
public static byte[] decipherTunnelPassword(byte[] data,
byte[] secret,
byte[] authenticator)
This algorithm performs a salt encoding of data but differs from the Salt Encoding by prepending a byte count field to the data.
data - Encoded data.secret - Shared secret.authenticator - Radius request authenticator
public static byte[] encrypt(byte[] password,
byte[] secretBytes,
byte[] authenticator)
password - Password to encrypt.secretBytes - NAS secret.authenticator - Authenticator from packet.
public static byte[] decrypt(byte[] encBytes,
byte[] secretBytes,
byte[] authenticator)
encBytes - Encoded bytes.secretBytes - Bytes forming the shared secret.authenticator - Packet authenticator.
public static byte[] encode3(byte[] data,
byte[] secretBytes,
byte[] authenticator)
data - Data to encode / decode.secretBytes - Bytes forming the shared secret.authenticator - Packet authenticator.
public static byte[] trim(byte[] passwordBytes)
passwordBytes - Password bytes as returned from decrypt.
public static boolean cmp(byte[] a,
byte[] b)
a - array ab - array b
public static byte[] genAuthenticator()
"Request Authenticator field SHOULD exhibit global and temporal uniqueness." We do this partly by hiding the origin of the random number by using a relatively unknown generator that's seeded by Java's generator seeded with the time. All silliness since the Shared Secret is probably really short.
public static byte[] limitSecretLength(byte[] data)
data - Input secret.
|
AXL Software® | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||