public class HostKeyDecrypter extends AbstractDecrypter
Modifier and Type | Class and Description |
---|---|
protected static class |
HostKeyDecrypter.OSType |
Modifier and Type | Field and Description |
---|---|
protected static java.util.logging.Logger |
LOG |
properties
Constructor and Description |
---|
HostKeyDecrypter() |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
doDecrypt(java.lang.String property,
java.lang.String value) |
static java.lang.String |
encrypt(java.lang.String plaintext)
Encrypts plaintext password using private key internal to host and AES
256 algorithm
|
protected static HostKeyDecrypter.OSType |
getOperatingSystemType(java.lang.String osName) |
static byte[] |
getSHA256Hash(byte[] input)
Performs a SHA-256 hash
|
protected void |
init_decrypter() |
static void |
main(java.lang.String[] args)
command line utility for doing password encryption
|
static byte[] |
xor(byte[] byteOne,
byte[] byteTwo)
Performs an xor on two byte arrays by doing an xor on each byte and
putting result into another byte array arrays of different length will
create an array of the longest where extra bytes are xor'd against 0 byte
|
decrypt, getConnectionURI, getProperty, init
protected void init_decrypter() throws java.io.IOException, java.lang.ClassNotFoundException
init_decrypter
in class AbstractDecrypter
java.io.IOException
java.lang.ClassNotFoundException
protected java.lang.String doDecrypt(java.lang.String property, java.lang.String value)
doDecrypt
in class AbstractDecrypter
public static byte[] xor(byte[] byteOne, byte[] byteTwo)
byteOne
- byteTwo
- public static byte[] getSHA256Hash(byte[] input) throws java.security.NoSuchAlgorithmException
input
- java.security.NoSuchAlgorithmException
protected static HostKeyDecrypter.OSType getOperatingSystemType(java.lang.String osName)
public static java.lang.String encrypt(java.lang.String plaintext) throws java.security.NoSuchAlgorithmException, javax.crypto.NoSuchPaddingException, java.security.InvalidKeyException, javax.crypto.IllegalBlockSizeException, javax.crypto.BadPaddingException, java.net.UnknownHostException, java.net.SocketException
plaintext
- javax.crypto.NoSuchPaddingException
java.security.NoSuchAlgorithmException
java.security.InvalidKeyException
javax.crypto.BadPaddingException
javax.crypto.IllegalBlockSizeException
java.net.SocketException
java.net.UnknownHostException
public static void main(java.lang.String[] args) throws java.lang.Exception
args
- java.lang.Exception