Package net.freehaven.tor.control
Class PasswordDigest
java.lang.Object
net.freehaven.tor.control.PasswordDigest
A hashed digest of a secret password (used to set control connection security.)
For the actual hashing algorithm, see RFC2440's secret-to-key conversion.
-
Constructor Summary
ConstructorsConstructorDescriptionPasswordDigest(byte[] secret) Construct a new password digest with a given secret and random saltPasswordDigest(byte[] secret, byte[] specifier) Construct a new password digest with a given secret and random salt. -
Method Summary
Modifier and TypeMethodDescriptionstatic PasswordDigestReturn a new password digest with a random secret and salt.Return the hashed password in the format used by Tor.byte[]Return the secret used to generate this password hash.static byte[]secretToKey(byte[] secret, byte[] specifier) Implement rfc2440 s2k
-
Constructor Details
-
PasswordDigest
public PasswordDigest(byte[] secret) Construct a new password digest with a given secret and random salt -
PasswordDigest
public PasswordDigest(byte[] secret, byte[] specifier) Construct a new password digest with a given secret and random salt. Note that the 9th byte of the specifier determines the number of hash iterations as in RFC2440.
-
-
Method Details
-
generateDigest
Return a new password digest with a random secret and salt. -
getSecret
public byte[] getSecret()Return the secret used to generate this password hash. -
getHashedPassword
Return the hashed password in the format used by Tor. -
secretToKey
public static byte[] secretToKey(byte[] secret, byte[] specifier) Implement rfc2440 s2k
-