org.pentaho.di.core.encryption
Class Encr

java.lang.Object
  extended by org.pentaho.di.core.encryption.Encr

public class Encr
extends Object

This class handles basic encryption of passwords in Kettle. Note that it's not really encryption, it's more obfuscation. Passwords are difficult to read, not impossible.

Since:
17-12-2003
Author:
Matt

Field Summary
static String PASSWORD_ENCRYPTED_PREFIX
          The word that is put before a password to indicate an encrypted form.
 
Constructor Summary
Encr()
           
 
Method Summary
 String buildSignature(String mac, String username, String company, String products)
           
static boolean checkSignatureShort(String signature, String verify)
           
static String decryptPassword(String encrypted)
           
static String decryptPasswordOptionallyEncrypted(String password)
          Decrypts a password if it contains the prefix "Encrypted "
static String encryptPassword(String password)
           
static String encryptPasswordIfNotUsingVariables(String password)
          Encrypt the password, but only if the password doesn't contain any variables.
static String getSignatureShort(String signature)
           
 boolean init()
           
static void main(String[] args)
          Create an encrypted password
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PASSWORD_ENCRYPTED_PREFIX

public static final String PASSWORD_ENCRYPTED_PREFIX
The word that is put before a password to indicate an encrypted form. If this word is not present, the password is considered to be NOT encrypted

See Also:
Constant Field Values
Constructor Detail

Encr

public Encr()
Method Detail

init

public boolean init()

buildSignature

public String buildSignature(String mac,
                             String username,
                             String company,
                             String products)

checkSignatureShort

public static final boolean checkSignatureShort(String signature,
                                                String verify)

getSignatureShort

public static final String getSignatureShort(String signature)

encryptPassword

public static final String encryptPassword(String password)

decryptPassword

public static final String decryptPassword(String encrypted)

encryptPasswordIfNotUsingVariables

public static final String encryptPasswordIfNotUsingVariables(String password)
Encrypt the password, but only if the password doesn't contain any variables.

Parameters:
password - The password to encrypt
Returns:
The encrypted password or the

decryptPasswordOptionallyEncrypted

public static final String decryptPasswordOptionallyEncrypted(String password)
Decrypts a password if it contains the prefix "Encrypted "

Parameters:
password - The encrypted password
Returns:
The decrypted password or the original value if the password doesn't start with "Encrypted "

main

public static void main(String[] args)
Create an encrypted password

Parameters:
args - the password to encrypt