Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello.
My question is if there is any solution to encrypt/decrypt the data in talend but without putting my password in clear in the code java because all the solution that i saw you need to put either your password or the key used to encrypt in the code in clear (For example tEncryptColumn /tDecryptColumn , JavaXCrypto,Jasypt ...) so i was wondering if there's any solution to do that .
For example: tMysqlInput -------Decrypt---------> Tmap --------Encrypt-------> tMysqlOutput
For the DB I'm using MySQL.
You need to either supply the full path to the Java class or import it.
This is very easy to implement using Jasypt (http://www.jasypt.org/) and system environment variables. On the machines running your jobs you can set up system environment variables which hold your passwords (or passwords to decrypt secondary passwords stored elsewhere for extra obfuscation), then in your jobs use Jasypt to encrypt/decrypt your data. It requires a bit of Java, but it really isn't that difficult to achieve. Jasypt is actually supplied with Talend, so you shouldn't need to download anything for this.
Thank you for replying
My question is how to make the connection between my system environment variables and Jasyp in talend . do i need to create new contexte ?
This code is from a routine I use in my Talend jobs......
public static String getEnvironmentVariable(String variableName) {
String returnVal = System.getenv(variableName);
if (returnVal == null) {
System.out.println(variableName
+ " does not exist or holds no value");
}
return returnVal;
}
thank you for the example
So i wrote a java code and i'm getting this error : StandardPBEStringEncryptor cannot be resolved to a type :
this is m'y code :
String mdp = System.getenv("MDP");
if (mdp == null) {
System.out.println(
" does not exist");
} else System.out.println(mdp);
StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor();
encryptor.setPassword(mdp); // we HAVE TO set a password
encryptor.setAlgorithm("PBEWithMD5AndTripleDES");
String encryptedText = encryptor.encrypt(row2.libelle_bu);
You need to either supply the full path to the Java class or import it.